diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-06-18 10:04:04 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-06-18 21:08:10 +0200 |
commit | b627b4e51b6fb4f01e628021fc0367fe05347675 (patch) | |
tree | f6aa69d19c14d224f70dd4f080aeaf922ab6699d /src/qml/Qt6QmlBuildInternals.cmake | |
parent | 06b3f1f2e7898b72b6c2baf87d63c118dc1ae267 (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
Pick-to: 6.2
Change-Id: Ifd478a5495b36c7ba127d4b8bea2ec1225035744
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlBuildInternals.cmake')
-rw-r--r-- | src/qml/Qt6QmlBuildInternals.cmake | 8 |
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 |