diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2024-03-13 14:53:18 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-19 19:41:43 +0000 |
commit | cf932db57f51bc6096814490f589230df88ea2b6 (patch) | |
tree | 56bfe888c5af27719a32284b0fc352d681f9e033 /cmake | |
parent | c7be15e7175da594e3c209ff0b0673aefe572509 (diff) |
CMake: Recompute QT_DEPLOY_PREFIX for each built example
The current deployment api implementation sets the value of
QT_DEPLOY_PREFIX based on CMAKE_INSTALL_PREFIX, if no QT_DEPLOY_PREFIX
was previously specified.
This does not work properly when multiple examples are placed in the
same subdirectory and are using deployment api.
Make sure to unset the QT_DEPLOY_PREFIX for each
qt_internal_add_example call, so that a correct prefix is computed for
each example, based on the modified CMAKE_INSTALL_PREFIX value that we
set for each example.
Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c5d0e93199beea314e4e4607c8ef5f7c29162666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuildRepoExamplesHelpers.cmake | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmake/QtBuildRepoExamplesHelpers.cmake b/cmake/QtBuildRepoExamplesHelpers.cmake index b9186a0044..149cffa15b 100644 --- a/cmake/QtBuildRepoExamplesHelpers.cmake +++ b/cmake/QtBuildRepoExamplesHelpers.cmake @@ -252,7 +252,9 @@ function(qt_internal_add_example_in_tree subdir) install(CODE " # Unset the CMAKE_INSTALL_PREFIX in the current cmake_install.cmake file so that it can be # overridden in the included add_subdirectory-specific cmake_install.cmake files instead. +# Also unset the deployment prefix, so it can be recomputed for each example subdirectory. unset(CMAKE_INSTALL_PREFIX) +unset(QT_DEPLOY_PREFIX) ") # Override the install prefix in the subdir cmake_install.cmake, so that |