Clion中配置Qt环境

Clion中配置Qt环境

cmake_minimum_required(VERSION 3.23)
project(untitled)

set(CMAKE_CXX_STANDARD 14)
set(set(CMAKE_INCLUDE_CURRENT_DIR ON))
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)

set(CMAKE_PREFIX_PATH /home/caijingbo/Qt/6.4.1/gcc_64)
find_package(Qt6 COMPONENTS
        Core
        Gui
        Widgets
        REQUIRED)
set(SOURCE_FILES main.cpp Widget.cpp Widget.h)
add_executable(untitled main.cpp)
target_link_libraries(untitled
        Qt::Core
        Qt::Gui
        Qt::Widgets
        )

你可能感兴趣的:(C++,clion,Qt,qt,c++,开发语言)