2023-04-01 21:01:46 +08:00
|
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
project(FluentUI)
|
|
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
|
|
|
|
|
find_package(Qt6 COMPONENTS Core Quick Svg REQUIRED)
|
|
|
|
|
set(QT_INSTALL_QML ${Qt6Core_DIR}/../../../qml)
|
|
|
|
|
set(TARGET_TYPE SHARED)
|
2023-04-01 21:42:32 +08:00
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
2023-04-01 21:37:07 +08:00
|
|
|
|
|
2023-04-08 19:45:39 +08:00
|
|
|
|
if(WIN32)
|
|
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-04-01 21:01:46 +08:00
|
|
|
|
set(TARGET_RESOURCES res.qrc)
|
|
|
|
|
set(TARGET_SOURCES
|
|
|
|
|
Def.cpp
|
|
|
|
|
FluApp.cpp
|
|
|
|
|
FluColorSet.cpp
|
|
|
|
|
FluColors.cpp
|
|
|
|
|
FluRegister.cpp
|
|
|
|
|
FluTheme.cpp
|
|
|
|
|
Fluent.cpp
|
|
|
|
|
FluentUI.cpp
|
2023-04-13 15:01:04 +08:00
|
|
|
|
NativeEventFilter.cpp
|
2023-04-01 21:01:46 +08:00
|
|
|
|
WindowHelper.cpp
|
|
|
|
|
qml_plugin.cpp
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set(TARGET_HEADERS
|
|
|
|
|
Def.h
|
|
|
|
|
FluApp.h
|
|
|
|
|
FluColorSet.h
|
|
|
|
|
FluColors.h
|
|
|
|
|
FluRegister.h
|
|
|
|
|
FluTheme.h
|
|
|
|
|
Fluent.h
|
|
|
|
|
FluentUI.h
|
2023-04-13 15:01:04 +08:00
|
|
|
|
NativeEventFilter.h
|
2023-04-01 21:01:46 +08:00
|
|
|
|
WindowHelper.h
|
|
|
|
|
qml_plugin.h
|
|
|
|
|
stdafx.h
|
|
|
|
|
)
|
|
|
|
|
|
2023-04-03 22:45:18 +08:00
|
|
|
|
add_definitions(-DVERSION_IN="1.0.0")
|
2023-04-23 10:26:06 +08:00
|
|
|
|
add_definitions(-DURI_STR="FluentUI")
|
2023-04-03 22:45:18 +08:00
|
|
|
|
|
2023-04-01 21:01:46 +08:00
|
|
|
|
add_library(${PROJECT_NAME} ${TARGET_TYPE} ${TARGET_SOURCES} ${TARGET_HEADERS} ${TARGET_RESOURCES})
|
|
|
|
|
|
2023-04-01 21:37:07 +08:00
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/FluentUI)
|
|
|
|
|
|
2023-04-01 21:01:46 +08:00
|
|
|
|
if(WIN32)
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE dwmapi user32)
|
|
|
|
|
else()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Svg)
|
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
include(build_windows.cmake)
|
|
|
|
|
else()
|
|
|
|
|
include(build_macos.cmake)
|
|
|
|
|
endif()
|