aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-06-18 10:04:04 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-18 20:18:27 +0000
commit90608633361c977f70f2ccf00c5cf1f48d78ed79 (patch)
tree8c4b34a7c340bf308daa9734e8786f2871272111
parentd84465fb099d256b65b89adf22d71b52f782237d (diff)
CMake: Allow using an existing target as a backing target
This was previously achieved by passing a NO_CREATE_BACKING_TARGET internal option to qt_internal_add_qml_module. Now it's just a conditional check to only create the backing target if it doesn't exist yet. This aligns with the behavior of the public qt_add_qml_module function. The old option is deprecated and will be removed once all repos mentioning it don't use it anymore. Amends cb293ee3afea3fe0cfabee58b4d34c278f17b709 Change-Id: Ifd478a5495b36c7ba127d4b8bea2ec1225035744 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b627b4e51b6fb4f01e628021fc0367fe05347675) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/Qt6QmlBuildInternals.cmake8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake
index a9cc7ef3f7..5dd451554d 100644
--- a/src/qml/Qt6QmlBuildInternals.cmake
+++ b/src/qml/Qt6QmlBuildInternals.cmake
@@ -70,15 +70,12 @@ function(qt_internal_add_qml_module target)
# Args used by qt_internal_add_qml_module directly, which should not be passed to any other
# functions.
#
- # NO_CREATE_BACKING_TARGET option skips the creation of the backing target. It is useful in
- # the case where the backing target already exists, a plugin target should still be created
- # and the qml specific install rules should still apply to the backing target.
- #
# INSTALL_SOURCE_QMLTYPES takes a path to an existing plugins.qmltypes file that should be
# installed.
#
# INSTALL_SOURCE_QMLDIR takes a path to an existing qmldir file that should be installed.
set(internal_option_args
+ # TODO: For backward compatibility, remove once all repos no longer use it
NO_CREATE_BACKING_TARGET
)
@@ -137,7 +134,8 @@ function(qt_internal_add_qml_module target)
set(plugin_args "")
if(NOT arg_PLUGIN_TARGET STREQUAL target)
- if(NOT arg_NO_CREATE_BACKING_TARGET)
+ # Allow using an existing backing target.
+ if(NOT TARGET ${target})
# Create the backing target now to handle module-related things
qt_remove_args(module_args
ARGS_TO_REMOVE