aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-16 15:37:09 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-17 16:11:13 +0100
commitbb1998e29d3f7d867f55f4c95bbc75ab0961a3b0 (patch)
tree93eda78cc80e6f8427bba8fc9fe68b1fb14b4f1b /src/qml/Qt6QmlMacros.cmake
parentf4937a21b61bf2f214d175d77c432c68f25ead21 (diff)
CMake: Handle QT_QML_SKIP_QMLDIR_ENTRY property
Add a new source file property QT_QML_SKIP_QMLDIR_ENTRY which tells the build system not to add the source file as an entry in the generated qmldir file. This is useful to mark a file for installation via qt6_target_qml_files without exposing it as a QML type (like a helper javascript file). Change-Id: I2aa595692bcbb65925635abc1b12519d1a45fe53 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 3b38662b44..1c79c58045 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -343,6 +343,9 @@ endfunction()
# type.
# 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.
+# QT_QML_SKIP_QMLDIR_ENTRY: When set to true, no qmldir entry will be created for
+# the source file. Useful if a file needs to be installed (like a private JS
+# file) but does not expose a public type.
#
# e.g.:
# set_source_files_properties(my_qml_file.qml
@@ -403,6 +406,12 @@ function(qt6_target_qml_files target)
if (skip_type_registration AND qml_file MATCHES "\\.qml$")
continue()
endif()
+
+ get_source_file_property(qml_file_skip_qmldir ${qml_file} QT_QML_SKIP_QMLDIR_ENTRY)
+ if (qml_file_skip_qmldir)
+ continue()
+ endif()
+
get_source_file_property(qml_file_version ${qml_file} QT_QML_SOURCE_VERSION)
get_source_file_property(qml_file_typename ${qml_file} QT_QML_SOURCE_TYPENAME)
get_source_file_property(qml_file_singleton ${qml_file} QT_QML_SINGLETON_TYPE)