Qt__CMakeLists.txt

cmake_minimum_required(VERSION 3.1.0)

project (Project)

if(CMAKE_COMPILER_IS_GNUCC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++0x")
else()
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

find_package(Qt5 REQUIRED Widgets Gui Core OpenGL Xml)

#头文件
include_directories (BEFORE ./src/)

#源文件
set(SOURCES_FILES
    ./src/main.cpp
    )



#set(CMAKE_INCLUDE_CURRENT_DIR ON)
#set(CMAKE_AUTOMOC ON)
#set(CMAKE_AUTOUIC ON)
#set(CMAKE_AUTORCC ON)
#set(RESOURCE_DIR resources/resources.qrc)
#QT5_WRAP_CPP(HEADERS_MOC ${INCLUDE_FILES})
#QT5_WRAP_UI(FORMS_HEADERS ${FORMS})
#QT5_ADD_RESOURCES(RESOURCES_RCC ${RESOURCES})

add_executable (Project ${SOURCES_FILES} ${MOCS})

target_link_libraries( Project Qt5::Widgets Qt5::Core Qt5::Gui Qt5::OpenGL Qt5::Xml)


posted @ 2018-05-30 17:03  narjaja  阅读(888)  评论(0编辑  收藏  举报