diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-07-23 16:03:32 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-07-27 16:59:32 +0200 |
commit | fcee684f1897b0cf1c36a5598ea1796718e2b2a6 (patch) | |
tree | 5f4bfb9fa1773d0d0daa93aec9a383810cfaa9b5 /src/qml | |
parent | 382d2bfe5f261c269ccf4b970c826003c90d57ae (diff) |
Add internal getter for qml_module_keywords cmake function
Follow pattern from qtbase and add getter for keywords,
this allows to wrap add_qml_module function and filter
some options in other modules.
This is currently need to fix top level builds for webengine,
which are used by RTA builds.
Task-number: QTBUG-95152
Task-number: QTBUG-94922
Pick-to: 6.2
Change-Id: I7d9c206e61a99154c45eb188145c2bdee6820665
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/Qt6QmlBuildInternals.cmake | 101 |
1 files changed, 57 insertions, 44 deletions
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake index ea5d3606ce..b85b76c414 100644 --- a/src/qml/Qt6QmlBuildInternals.cmake +++ b/src/qml/Qt6QmlBuildInternals.cmake @@ -4,30 +4,10 @@ include_guard(GLOBAL) -# This function is essentially a wrapper around qt6_add_qml_module(). -# It creates the targets explicitly and sets up internal properties before -# passing those targets to qt6_add_qml_module() for further updates. -# All keywords supported by qt_internal_add_module() can be used, as can most -# keywords for qt6_add_qml_module() except RESOURCE_PREFIX and -# OUTPUT_TARGETS. -# -# OUTPUT_DIRECTORY and INSTALL_DIRECTORY will be given more appropriate defaults -# if not provided by the caller. The defaults are usually what you want to use. -# -# - SOURCES is only passed through to qt_internal_add_plugin() or -# qt_internal_add_module() but not to qt6_add_qml_module(). -# -# See qt_internal_add_plugin() and qt6_add_qml_module() for the full set of -# supported keywords. -function(qt_internal_add_qml_module target) - - qt_internal_get_internal_add_module_keywords( - module_option_args - module_single_args - module_multi_args - ) - - set(qml_module_option_args +macro(qt_internal_get_internal_add_qml_module_keywords + option_args single_args multi_args + internal_option_args internal_single_args internal_multi_args) + set(${option_args} DESIGNER_SUPPORTED NO_PLUGIN_OPTIONAL NO_CREATE_PLUGIN_TARGET @@ -37,15 +17,7 @@ function(qt_internal_add_qml_module target) NO_LINT NO_CACHEGEN ) - # TODO: Remove these once all repos have been updated to not use them - set(ignore_option_args - SKIP_TYPE_REGISTRATION # Now always done - PLUGIN_OPTIONAL # Now the default - GENERATE_QMLTYPES # Now the default - INSTALL_QMLTYPES # Now the default - ) - - set(qml_module_single_args + set(${single_args} URI VERSION PLUGIN_TARGET @@ -54,9 +26,7 @@ function(qt_internal_add_qml_module target) CLASSNAME # TODO: Remove once all other repos have been updated to use # CLASS_NAME instead. ) - - set(qml_module_multi_args - # SOURCES will be handled by qt_internal_add_module() + set(${multi_args} QML_FILES RESOURCES IMPORTS @@ -65,7 +35,6 @@ function(qt_internal_add_qml_module target) DEPENDENCIES PAST_MAJOR_VERSIONS ) - # Args used by qt_internal_add_qml_module directly, which should not be passed to any other # functions. # @@ -73,28 +42,71 @@ function(qt_internal_add_qml_module target) # installed. # # INSTALL_SOURCE_QMLDIR takes a path to an existing qmldir file that should be installed. - set(internal_option_args + set(${internal_option_args} ) - - set(internal_single_args + set(${internal_single_args} INSTALL_SOURCE_QMLTYPES INSTALL_SOURCE_QMLDIR ) + set(${internal_multi_args} + ) + +endmacro() + +# This function is essentially a wrapper around qt6_add_qml_module(). +# It creates the targets explicitly and sets up internal properties before +# passing those targets to qt6_add_qml_module() for further updates. +# All keywords supported by qt_internal_add_module() can be used, as can most +# keywords for qt6_add_qml_module() except RESOURCE_PREFIX and +# OUTPUT_TARGETS. +# +# OUTPUT_DIRECTORY and INSTALL_DIRECTORY will be given more appropriate defaults +# if not provided by the caller. The defaults are usually what you want to use. +# +# - SOURCES is only passed through to qt_internal_add_plugin() or +# qt_internal_add_module() but not to qt6_add_qml_module(). +# +# See qt_internal_add_plugin() and qt6_add_qml_module() for the full set of +# supported keywords. +function(qt_internal_add_qml_module target) + + qt_internal_get_internal_add_module_keywords( + module_option_args + module_single_args + module_multi_args + ) + + qt_internal_get_internal_add_qml_module_keywords( + qml_module_option_args + qml_module_single_args + qml_module_multi_args + qml_module_internal_option_args + qml_module_internal_single_args + qml_module_internal_multi_args + ) + # TODO: Remove these once all repos have been updated to not use them + set(ignore_option_args + SKIP_TYPE_REGISTRATION # Now always done + PLUGIN_OPTIONAL # Now the default + GENERATE_QMLTYPES # Now the default + INSTALL_QMLTYPES # Now the default + ) set(option_args ${module_option_args} ${qml_module_option_args} ${ignore_option_args} - ${internal_option_args} + ${qml_module_internal_option_args} ) set(single_args ${module_single_args} ${qml_module_single_args} - ${internal_single_args} + ${qml_module_internal_single_args} ) set(multi_args ${module_multi_args} ${qml_module_multi_args} + ${qml_module_internal_multi_args} ) qt_parse_all_arguments(arg "qt_internal_add_qml_module" @@ -139,8 +151,9 @@ function(qt_internal_add_qml_module target) ${qml_module_option_args} ${qml_module_single_args} ${qml_module_multi_args} - ${internal_option_args} - ${internal_single_args} + ${qml_module_internal_option_args} + ${qml_module_internal_single_args} + ${qml_module_internal_multi_args} OUTPUT_DIRECTORY INSTALL_DIRECTORY ALL_ARGS |