summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-10-23 12:45:10 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-10-26 13:46:49 +0100
commit20292250d44e08437306096e9096fc655cc9fb8b (patch)
treed2b727c15e9d91aa2c30cc21a2ac8e1d11972088 /cmake
parent5fa823491b3f1a3d6f8161639686a0fbc33e6f03 (diff)
CMake: Fix handling of rpaths for tests with CMAKE_STAGING_PREFIX
Task-number: QTBUG-86053 Change-Id: I2f368d9dc2d871b67bd6261aadd8ef4c1dd1ae54 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuildInternals/QtBuildInternalsConfig.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
index 246ee3b17b..40d495d414 100644
--- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
+++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake
@@ -452,6 +452,18 @@ function(qt_set_up_fake_standalone_tests_install_prefix)
message(STATUS
"Setting local standalone test install prefix (non-cached) to '${new_install_prefix}'.")
set(CMAKE_INSTALL_PREFIX "${new_install_prefix}" PARENT_SCOPE)
+
+ # We also need to clear the staging prefix if it's set, otherwise CMake will modify any computed
+ # rpaths containing the staging prefix to point to the new fake prefix, which is not what we
+ # want. This replacement is done in cmComputeLinkInformation::GetRPath().
+ #
+ # By clearing the staging prefix for the standalone tests, any detected link time
+ # rpaths will be embedded as-is, which will point to the place where Qt was installed (aka
+ # the staging prefix).
+ if(DEFINED CMAKE_STAGING_PREFIX)
+ message(STATUS "Clearing local standalone test staging prefix (non-cached).")
+ set(CMAKE_STAGING_PREFIX "" PARENT_SCOPE)
+ endif()
endfunction()
# Mean to be called when configuring examples as part of the main build tree, as well as for CMake