update
parent
86790c9562
commit
0c19164c54
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
||||||
#安装
|
#安装
|
||||||
|
|
|
@ -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.dll与fluentuipluginplugin.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()
|
||||||
|
|
||||||
#如果是debug,则生成的库文件名后面拼接d
|
#如果是debug,则生成的库文件名后面拼接d
|
||||||
set_target_properties(fluentui PROPERTIES DEBUG_POSTFIX "d")
|
|
||||||
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")
|
set_target_properties(fluentuiplugin PROPERTIES DEBUG_POSTFIX "d")
|
||||||
|
|
Loading…
Reference in New Issue