mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 19:20:59 +08:00
37 lines
1.2 KiB
CMake
37 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(FluentUI VERSION 1.0)
|
|
|
|
if (MSVC)
|
|
#让Release也生成pdb文件
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
|
|
endif ()
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/.cmake/)
|
|
|
|
include(GetGitRevisionDescription)
|
|
|
|
option(FLUENTUI_BUILD_EXAMPLES "Build FluentUI demo applications." ON)
|
|
option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF)
|
|
|
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
|
|
|
add_subdirectory(src)
|
|
|
|
#Release也支持日志打印代码位置
|
|
target_compile_definitions(fluentuiplugin
|
|
PRIVATE
|
|
QT_MESSAGELOGCONTEXT
|
|
)
|
|
|
|
if (FLUENTUI_BUILD_EXAMPLES)
|
|
add_subdirectory(example)
|
|
endif ()
|
|
|
|
message("------------------------ FluentUI ------------------------")
|
|
message("Build FluentUI demo applications.: ${FLUENTUI_BUILD_EXAMPLES}")
|
|
message("Build static library.: ${FLUENTUI_BUILD_STATIC_LIB}")
|
|
message("Path to FluentUI plugin.: ${FLUENTUI_QML_PLUGIN_DIRECTORY}")
|