92 lines
1.9 KiB
CMake
92 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.5)
|
||
|
||
include_directories(third/lua/include)
|
||
link_directories(third/lua/lib)
|
||
link_libraries(lua)
|
||
set(CMAKE_CXX_STANDARD 17)
|
||
|
||
|
||
project(protoDebuger LANGUAGES CXX)
|
||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||
|
||
set(CMAKE_AUTOUIC FALSE)
|
||
set(CMAKE_AUTOMOC FALSE)
|
||
set(CMAKE_AUTORCC FALSE)
|
||
|
||
set(CMAKE_CXX_STANDARD 11)
|
||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
|
||
find_package(Qt5 COMPONENTS Core Quick Widgets REQUIRED)
|
||
|
||
set(HEADERS # 待预编译的cpp头文件
|
||
qserialproto.h
|
||
globalvar.h
|
||
serialcontroller.h
|
||
sharedata.h
|
||
network_controller.h
|
||
|
||
)
|
||
|
||
set(SOURCES # 待预编译的cpp代码
|
||
serialcontroller.cpp
|
||
globalvar.cpp
|
||
sharedata.cpp
|
||
lua_wraper.cpp
|
||
lua_bind.cpp
|
||
network_controller.cpp
|
||
)
|
||
|
||
set(RESOURCES
|
||
qml.qrc
|
||
)
|
||
|
||
set(QMLS
|
||
main.qml
|
||
)
|
||
|
||
set (NO_MOC_SOURCES
|
||
main.cpp
|
||
globalvar.cpp
|
||
)
|
||
|
||
set (UIS
|
||
${QsswraperUI}
|
||
)
|
||
|
||
include(D:\\project\\c++qt\\qsswraper\\CMakeLists.txt)
|
||
|
||
QT5_WRAP_CPP(MOC ${SOURCES} ) # moc预编译代码
|
||
QT5_WRAP_CPP(MOCHEADER ${HEADERS} ) # moc预编译代码
|
||
QT5_ADD_RESOURCES(RCC ${RESOURCES}) # rcc生成资源cpp
|
||
QT5_WRAP_UI(UIC ${UIS}) # uic生成ui_x.h
|
||
|
||
|
||
FOREACH(list ${UIC})
|
||
message("MOC " ${list} )
|
||
ENDFOREACH(list)
|
||
|
||
FOREACH(list ${MOC})
|
||
message("MOC " ${list} )
|
||
ENDFOREACH(list)
|
||
FOREACH(list ${NO_MOC_SOURCES})
|
||
message("NO_MOC_SOURCES " ${list} )
|
||
ENDFOREACH(list)
|
||
|
||
add_executable(protoDebuger #最后需要参与链接生成的是
|
||
${SOURCES} #1. 原先的cpp代码,
|
||
${MOC} #2. 预编译后的cpp
|
||
${RCC} #3. 资源cpp代码
|
||
${UIC}
|
||
${NO_MOC_SOURCES}
|
||
)
|
||
|
||
target_compile_definitions(protoDebuger
|
||
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
||
|
||
find_package( Qt5SerialPort)
|
||
find_package( Qt5QuickWidgets)
|
||
|
||
target_link_libraries(protoDebuger
|
||
PRIVATE Qt5::Core Qt5::Quick Qt5::Widgets Qt5::SerialPort Qt5::Network Qt5::QuickWidgets)
|