Qt的CMakefiles样本1

cmake_minimum_required(VERSION 3.1)
 
project(untitled3 LANGUAGES CXX)
 
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
find_package(Qt5 COMPONENTS core widgets REQUIRED)
 
add_executable(${PROJECT_NAME} "main.cpp" "qml.qrc")
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets)
##特别注意是Qt5而不是Qt