aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-10-08 15:33:57 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-10-08 13:42:20 +0000
commit5f07a0e1149ed3df41f3ff5ef55f3f8bbad99909 (patch)
tree28c9a533930311455314cb6ecd13724846d198ca
parent020b3b3dde8ca0ed6506662154051430788c6054 (diff)
Add INSTALL_QML_FILES option to qt6_add_qml_module()
When present, this option will cause all qml files to be installed alongside the plugin binary. Change-Id: I0e1be50aeea7a47929172ff277dd4619a895ada0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/qml/Qt6QmlMacros.cmake16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index a4b4a47d77..71e6b2230c 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -33,9 +33,12 @@
#
# DO_NOT_INSTALL_METADATA: When present, will not install the supporting files.
#
+# INSTALL_QML_FILES: When present, will install the qml files along side the
+# plugin.
+#
# SOURCES: List of C++ sources. (OPTIONAL)
#
-# DEPENDENCIES: List of QML Module depdencies and their versions. The module
+# DEPENDENCIES: List of QML Module dependencies and their versions. The module
# and its version must be separated via a slash(/). E.g. QtQuick/2.0
#
# QML_FILES: List of Qml files. See qt6_target_qml_files for more information
@@ -72,6 +75,7 @@ function(qt6_add_qml_module target)
DESIGNER_SUPPORTED
DO_NOT_INSTALL_METADATA
SKIP_TYPE_REGISTRATION
+ INSTALL_QML_FILES
)
if (QT_BUILDING_QT)
@@ -182,6 +186,10 @@ function(qt6_add_qml_module target)
endif()
endif()
+ if (arg_INSTALL_QML_FILES)
+ set_target_properties(${target} PROPERTIES QT_QML_MODULE_INSTALL_QML_FILES TRUE)
+ endif()
+
if (arg_SKIP_TYPE_REGISTRATION)
set_target_properties(${target} PROPERTIES QT_QML_MODULE_SKIP_TYPE_REGISTRATION TRUE)
endif()
@@ -316,8 +324,6 @@ endfunction()
# type name will be deduced using the file's basename.
# QT_QML_SINGLETON_TYPE: Set to true if this qml file contains a singleton
# type.
-# QT_QML_SOURCE_INSTALL: When set to true, the file will be installed alongside
-# the module.
# QT_QML_INTERNAL_TYPE: When set to true, the type specified by
# QT_QML_SOURCE_TYPENAME will not be available to users of this module.
#
@@ -342,6 +348,7 @@ function(qt6_target_qml_files target)
cmake_parse_arguments(arg "" "" "FILES" ${ARGN})
get_target_property(resource_count ${target} QT6_QML_MODULE_ADD_QML_FILES_COUNT)
get_target_property(qmldir_file ${target} QT_QML_MODULE_QMLDIR_FILE)
+ get_target_property(install_qml_files ${target} QT_QML_MODULE_INSTALL_QML_FILES)
if (NOT qmldir_file)
message(FATAL_ERROR "qt6_target_qml_file: ${target} is not a Qml module")
endif()
@@ -368,8 +375,7 @@ function(qt6_target_qml_files target)
set(file_contents "")
foreach(qml_file IN LISTS arg_FILES)
- get_source_file_property(qml_file_install ${qml_file} QT_QML_SOURCE_INSTALL)
- if (qml_file_install)
+ if (install_qml_files)
install(FILES ${qml_file} DESTINATION ${qml_module_install_dir})
endif()