Skip to content

Commit

Permalink
CMake: Recompute QT_DEPLOY_PREFIX for each built example
Browse files Browse the repository at this point in the history
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.

Pick-to: 6.7
Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
alcroito committed Mar 19, 2024
1 parent c909647 commit c5d0e93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/QtBuildRepoExamplesHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,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
Expand Down

0 comments on commit c5d0e93

Please sign in to comment.