CMakeLists配置

CMakeList配置

  1. #指定cmake的最小版本号
    CMAKE_MINIMUM_REQUIRED(VERSION 3.6.0)
  2. #指定项目名称
    PROJECT(PMTRTemp)
  3. #指定Qt路径和启用当前目录(按需设置)
    SET(CMAKE_PREFIX_PATH $ENV{QTDIR512})
    SET(QT_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui Qt5::DBus Qt5::Sql Qt5::SerialPort Qt5::Multimedia Qt5::MultimediaWidgets Qt5::Charts Qt5::Xml Qt5::XmlPatterns Qt5::Script Qt5::ScriptTools Qt5::PrintSupport)
  4. #引入Qt库
    FIND_PACKAGE(Qt5Widgets REQUIRED)
    FIND_PACKAGE(Qt5Gui REQUIRED)
    FIND_PACKAGE(Qt5Core REQUIRED)
  5. #设置文件的输出目录
    SET(OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
    SET(LIB_PATHEX ${PROJECT_SOURCE_DIR}/lib)
    SET(INCLUDE_PAHT ${PROJECT_SOURCE_DIR}/include)
  6. #添加子节点
    ADD_SUBDIRECTORY(PMTR)
    #ADD_SUBDIRECTORY(DBServer)
  7. #设置窗口程序对应的入口函数是Winmain,控制台程序对应的入口函数是 main
    #SET(CMAKE_EXE_LINKER_FLAGS “${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS”)
  8. #增加宏定义
    if(win32)
    ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
    endif(win32)
  9. #定义变量
    SET(CMAKE_BUILD_TYPE “Debug”)
    if(win32)
    set(PLATFORM win32)
    set(APP_NAME ${PROJECT_NAME}d.exe)
    set(SGX_LINK_PATH )
    else(win32)
    set(PLATFORM arm)
    set(APP_NAME ${PROJECT_NAME})
    endif(win32)
  10. #工具链
    if(ARM)
    SET(CMAKE_CXX_COMPILER arm-linux-g++)
    SET(CMAKE_BUILD_TYPE “Debug”)
    SET(CMAKE_CXX_FLAGS_DEBUG “-g -ggdb”)#-O0 -Wall
    endif()
  11. #多核编译
    if(win32)
    SET_TARGET_PROPERTIES(PMTRTemp PROPERTIES COMPILE_FLAGS “/MP”)
    else(win32)
    endif(win32)

CMakeLists.rule

  1. SET(modulename ExtendUI)
  2. SET(${modulename}_moc_files
    ${modulename}/ExtendAuxiliayItem.h
    ${modulename}/ExtendChartView.h
    ${modulename}/ExtendCheckBoxDelegate.h
    ${modulename}/ExtendGraphicsSplineWgt.h
    ${modulename}/ExtendLineWgt.h
    ${modulename}/ExtendListWgtDelegate.h
    ${modulename}/ExtendPagenavigator.h
    )
  3. SET(${modulename}_source_files
    ${modulename}/ExtendAuxiliayItem.cpp
    ${modulename}/ExtendChartView.cpp
    ${modulename}/ExtendCheckBoxDelegate.cpp
    ${modulename}/ExtendGraphicsSplineWgt.cpp
    ${modulename}/ExtendLineWgt.cpp
    ${modulename}/ExtendListWgtDelegate.cpp
    ${modulename}/ExtendPagenavigator.cpp
    )
  4. SOURCE_GROUP(${modulename} FILES KaTeX parse error: Expected '}', got 'EOF' at end of input: {{modulename}_source_files} KaTeX parse error: Expected '}', got 'EOF' at end of input: {{modulename}_moc_files})
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值