AicsKnowledgeBase_client/AicsKnowledgeBase/CMakeLists.txt

55 lines
1.5 KiB
CMake
Raw Normal View History

2023-06-13 14:42:55 +08:00
cmake_minimum_required(VERSION 3.16)
project(AicsKnowledgeBase LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2023-06-16 21:07:11 +08:00
find_package(Qt6 COMPONENTS Quick REQUIRED)
#遍历所有Cpp文件
file(GLOB_RECURSE CPP_FILES src/*.cpp src/*.h)
foreach(filepath ${CPP_FILES})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND sources_files ${filename})
endforeach(filepath)
#遍历所有qml文件
file(GLOB_RECURSE QML_PATHS qml/*.qml)
foreach(filepath ${QML_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND qml_files ${filename})
endforeach(filepath)
#遍历所有资源文件
file(GLOB_RECURSE RES_PATHS res/*.png res/*.jpg res/*.svg res/*.ico res/*.ttf res/*.webp res/qmldir)
foreach(filepath ${RES_PATHS})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" filename ${filepath})
list(APPEND resource_files ${filename})
endforeach(filepath)
2023-06-13 14:42:55 +08:00
qt_add_executable(AicsKnowledgeBase
2023-06-16 21:07:11 +08:00
${sources_files}
2023-06-13 14:42:55 +08:00
)
qt_add_qml_module(AicsKnowledgeBase
URI AicsKnowledgeBase
VERSION 1.0
2023-06-16 21:07:11 +08:00
QML_FILES ${qml_files}
RESOURCES ${resource_files}
2023-06-13 14:42:55 +08:00
)
set_target_properties(AicsKnowledgeBase PROPERTIES
WIN32_EXECUTABLE TRUE
)
target_compile_definitions(AicsKnowledgeBase
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(AicsKnowledgeBase PRIVATE
Qt6::Quick
fluentuiplugin
FramelessHelper::Core
FramelessHelper::Quick
2023-06-18 00:06:24 +08:00
)