summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6CoreMacros.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2023-01-27 15:36:31 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2023-02-09 11:27:29 +0100
commit6c28528e40bc0e730ef3828595b4ef83a373a697 (patch)
treec92a09084929005244ee2501ddeb2359c17b5ebb /src/corelib/Qt6CoreMacros.cmake
parent5ae8417c4f6348ab9f78a93fbb83e0c27c57d288 (diff)
CMake: Fix directory scoping issue for qt6_generate_deploy_script
Consider a Qt target created in a subdirectory and a call to qt6_generate_deploy_app_script(target) in the parent directory. Once qt6_generate_deploy_script (called by qt6_generate_deploy_app_script) is run, the target has already been finalized. However, qt6_generate_deploy_script needs to run before finalization, because: - qt6_generate_deploy_script marks the target as to be deployed - the finalizer generates plugins information only if the target was marked to be deployed Fix this in qt6_generate_deploy_script by checking whether the target was already finalized. In that case, generate the plugin deployment information right away. Pick-to: 6.5 Fixes: QTBUG-109741 Change-Id: Idf60f9e21f038c1a33843177d9299230857ee70b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index c1ea6fde58..44f0a86aaa 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -2910,6 +2910,13 @@ function(qt6_generate_deploy_script)
# Mark the target as "to be deployed".
set_property(TARGET ${arg_TARGET} PROPERTY _qt_marked_for_deployment ON)
+ # If the target already was finalized, maybe because it was defined in a subdirectory, generate
+ # the plugin deployment information here.
+ get_target_property(is_finalized "${arg_TARGET}" _qt_is_finalized)
+ if(is_finalized)
+ __qt_internal_generate_plugin_deployment_info(${arg_TARGET})
+ endif()
+
# Create a file name that will be unique for this target and the combination
# of arguments passed to this command. This allows the project to call us
# multiple times with different arguments for the same target (e.g. to