main
zhuzihcu 2023-05-12 10:40:27 +08:00
parent 86790c9562
commit 0c19164c54
2 changed files with 13 additions and 13 deletions

View File

@ -93,7 +93,7 @@ set_target_properties(example PROPERTIES
# #
target_link_libraries(example PRIVATE target_link_libraries(example PRIVATE
Qt6::Quick Qt6::Quick
fluentui fluentuiplugin
) )
# #

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(fluentui LANGUAGES CXX) project(fluentuiplugin LANGUAGES CXX)
# #
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
@ -9,11 +9,8 @@ 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->D:\Qt\6.4.3\msvc2019_64\qml\FluentUI
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PREFIX_PATH}/bin) set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
##
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_PREFIX_PATH}/lib)
# #
add_definitions(-DVERSION=1,2,9,0) add_definitions(-DVERSION=1,2,9,0)
@ -48,19 +45,23 @@ foreach(filepath IN LISTS qml_files resource_files)
endforeach() endforeach()
#qml #qml
qt_add_library(fluentui SHARED) qt_add_library(fluentuiplugin SHARED)
qt_add_qml_module(fluentui qt_add_qml_module(fluentuiplugin
OUTPUT_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI #fluentuiplugin.dllfluentuipluginplugin.dll
PLUGIN_TARGET fluentuiplugin
OUTPUT_DIRECTORY ${QML_PLUGIN_DIRECTORY}
VERSION 1.0 VERSION 1.0
URI "FluentUI" URI "FluentUI"
SOURCES ${sources_files} fluentui.rc SOURCES ${sources_files} fluentui.rc
QML_FILES ${qml_files} QML_FILES ${qml_files}
RESOURCES ${resource_files} RESOURCES ${resource_files}
#designer
DESIGNER_SUPPORTED DESIGNER_SUPPORTED
) )
# #
target_link_libraries(fluentui PUBLIC target_link_libraries(fluentuiplugin PUBLIC
Qt::Core Qt::Core
Qt::Quick Qt::Quick
Qt::Qml Qt::Qml
@ -68,9 +69,8 @@ target_link_libraries(fluentui PUBLIC
# win32 mingw # win32 mingw
if(WIN32) if(WIN32)
target_link_libraries(fluentui PRIVATE dwmapi user32) target_link_libraries(fluentuiplugin PRIVATE dwmapi user32)
endif() endif()
#debugd #debugd
set_target_properties(fluentui PROPERTIES DEBUG_POSTFIX "d")
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d") set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")