mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-26 05:17:05 +08:00
update
This commit is contained in:
parent
d60002f3d9
commit
6b5b8a6b57
@ -7,7 +7,6 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
#判断FluentUI库类型
|
||||
@ -74,8 +73,13 @@ configure_file(
|
||||
)
|
||||
endif()
|
||||
|
||||
#加快qrc编译
|
||||
qt_add_big_resources(QRC_RESOURCES ${PROJECT_NAME}.qrc)
|
||||
list(APPEND QRC_RESOURCES ${PROJECT_NAME}.qrc)
|
||||
set_property(SOURCE ${PROJECT_NAME}.qrc PROPERTY SKIP_AUTORCC ON)
|
||||
list(APPEND sources_files ${QRC_RESOURCES})
|
||||
|
||||
#添加可执行文件
|
||||
list(APPEND sources_files ${PROJECT_NAME}.qrc)
|
||||
if(WIN32)
|
||||
list(APPEND sources_files ${EXAMPLE_VERSION_RC_PATH})
|
||||
endif()
|
||||
|
@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(%1 VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
@ -33,9 +32,13 @@ add_custom_target(Script-UpdateTranslations
|
||||
SOURCES ${TS_FILE_PATHS}
|
||||
)
|
||||
|
||||
qt_add_big_resources(QRC_RESOURCES qml.qrc)
|
||||
list(APPEND QRC_RESOURCES qml.qrc)
|
||||
set_property(SOURCE qml.qrc PROPERTY SKIP_AUTORCC ON)
|
||||
|
||||
set(PROJECT_SOURCES
|
||||
main.cpp
|
||||
qml.qrc
|
||||
${QRC_RESOURCES}
|
||||
)
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
|
@ -40,7 +40,7 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.3")
|
||||
else()
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
endif()
|
||||
|
||||
#国际化
|
||||
@ -139,12 +139,17 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.2")
|
||||
RESOURCE_PREFIX "/qt/qml"
|
||||
)
|
||||
else()
|
||||
#加快qrc编译
|
||||
set(QRC_FILE Qt5/imports/fluentui.qrc)
|
||||
qt_add_big_resources(QRC_RESOURCES ${QRC_FILE})
|
||||
list(APPEND QRC_RESOURCES ${QRC_FILE})
|
||||
set_property(SOURCE ${QRC_FILE} PROPERTY SKIP_AUTORCC ON)
|
||||
#如果是Qt6.2版本以下,则使用add_qmlplugin函数添加资源文件,这是个自定义的函数,详情见.cmake/QmlPlugin.cmake
|
||||
include(QmlPlugin)
|
||||
add_qmlplugin(${PROJECT_NAME}
|
||||
URI "FluentUI"
|
||||
VERSION 1.0
|
||||
SOURCES ${sources_files} ${FLUENTUI_VERSION_RC_PATH} Qt5/imports/fluentui.qrc
|
||||
SOURCES ${sources_files} ${FLUENTUI_VERSION_RC_PATH} ${QRC_RESOURCES}
|
||||
QMLFILES ${qml_files}
|
||||
QMLDIR imports/FluentUI
|
||||
BINARY_DIR ${FLUENTUI_QML_PLUGIN_DIRECTORY}
|
||||
|
Loading…
Reference in New Issue
Block a user