fix: [build] old Qt build config

It should use qt5_add_resources if the Qt version less 5.15.

Log: Fix old Qt build config.
This commit is contained in:
re2zero 2024-09-23 10:16:41 +08:00
parent e771293269
commit 1183cbb8cb
1 changed files with 8 additions and 1 deletions

View File

@ -142,6 +142,8 @@ if (WIN32)
)
endif ()
message("Building with Qt version: ${QT_VERSION}")
if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
#Qt6.2使qt_add_libraryqt_add_qml_module
if (FLUENTUI_BUILD_STATIC_LIB)
@ -161,7 +163,12 @@ if (QT_VERSION VERSION_GREATER_EQUAL "6.2")
RESOURCE_PREFIX "/qt/qml"
)
else ()
qt_add_resources(QRC_RESOURCES Qt5/imports/fluentui.qrc)
# This command was introduced in Qt 5.15. You can use qt5_add_resources in older versions of Qt.
if (QT_VERSION VERSION_LESS "5.15")
qt5_add_resources(QRC_RESOURCES Qt5/imports/fluentui.qrc)
else()
qt_add_resources(QRC_RESOURCES Qt5/imports/fluentui.qrc)
endif()
#Qt6.2使add_qmlplugin.cmake/QmlPlugin.cmake
include(QmlPlugin)
add_qmlplugin(${PROJECT_NAME}