This commit is contained in:
朱子楚\zhuzi 2023-07-15 00:20:33 +08:00
parent 4df6800ea4
commit 561b4ec8c0
2 changed files with 10 additions and 9 deletions

View File

@ -6,6 +6,12 @@ option(FLUENTUI_BUILD_EXAMPLES "Build FluentUI demo applications." ON)
option(FLUENTUI_BUILD_FRAMELESSHEPLER "Build FramelessHelper." ON) option(FLUENTUI_BUILD_FRAMELESSHEPLER "Build FramelessHelper." ON)
option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF) option(FLUENTUI_BUILD_STATIC_LIB "Build static library." OFF)
#QML<QT_SDK_DIR_PATH>\qml\FluentUI
set(FLUENTUI_QML_PLUGIN_DIRECTORY "" CACHE PATH "Path to FluentUI plugin")
if(NOT FLUENTUI_QML_PLUGIN_DIRECTORY)
set(FLUENTUI_QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
endif()
add_subdirectory(src) add_subdirectory(src)
if (FLUENTUI_BUILD_EXAMPLES) if (FLUENTUI_BUILD_EXAMPLES)
@ -22,3 +28,4 @@ message("------------------------ FluentUI ------------------------")
message("Build FluentUI demo applications.: ${FLUENTUI_BUILD_EXAMPLES}") message("Build FluentUI demo applications.: ${FLUENTUI_BUILD_EXAMPLES}")
message("Build FramelessHelper.: ${FLUENTUI_BUILD_FRAMELESSHEPLER}") message("Build FramelessHelper.: ${FLUENTUI_BUILD_FRAMELESSHEPLER}")
message("Build static library.: ${FLUENTUI_BUILD_STATIC_LIB}") message("Build static library.: ${FLUENTUI_BUILD_STATIC_LIB}")
message("Path to FluentUI plugin.: ${FLUENTUI_QML_PLUGIN_DIRECTORY}")

View File

@ -11,12 +11,6 @@ if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE) set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "" FORCE)
endif() endif()
#QML<QT_SDK_DIR_PATH>\qml\FluentUI
set(QML_PLUGIN_DIRECTORY "" CACHE PATH "Path to FluentUI plugin")
if(NOT QML_PLUGIN_DIRECTORY)
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
endif()
# #
add_definitions(-DVERSION=1,3,7,4) add_definitions(-DVERSION=1,3,7,4)
@ -67,7 +61,7 @@ qt_add_library(${PROJECT_NAME} ${LIB_TYPE})
if (FLUENTUI_BUILD_STATIC_LIB) if (FLUENTUI_BUILD_STATIC_LIB)
qt_add_qml_module(${PROJECT_NAME} qt_add_qml_module(${PROJECT_NAME}
#使PLUGIN_TARGET #使PLUGIN_TARGET
OUTPUT_DIRECTORY ${QML_PLUGIN_DIRECTORY} OUTPUT_DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY}
VERSION 1.0 VERSION 1.0
URI "FluentUI" URI "FluentUI"
TYPEINFO "plugins.qmltypes" TYPEINFO "plugins.qmltypes"
@ -79,7 +73,7 @@ else()
qt_add_qml_module(${PROJECT_NAME} qt_add_qml_module(${PROJECT_NAME}
#fluentuiplugin.dllfluentuipluginplugin.dll #fluentuiplugin.dllfluentuipluginplugin.dll
PLUGIN_TARGET fluentuiplugin PLUGIN_TARGET fluentuiplugin
OUTPUT_DIRECTORY ${QML_PLUGIN_DIRECTORY} OUTPUT_DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY}
VERSION 1.0 VERSION 1.0
URI "FluentUI" URI "FluentUI"
#qmltypesfluentuiplugin.qmltypes使import FluentUIplugins.qmltypes #qmltypesfluentuiplugin.qmltypes使import FluentUIplugins.qmltypes
@ -98,4 +92,4 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
) )
# #
install(DIRECTORY ${QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports) install(DIRECTORY ${FLUENTUI_QML_PLUGIN_DIRECTORY} DESTINATION ${CMAKE_INSTALL_PREFIX}/imports)