diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-04 18:21:13 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-06-04 22:28:06 +0200 |
commit | 37b132cd4e081821ddc261d24abe8f914123547a (patch) | |
tree | 6dd63af256545e02bd27030fb2f4a0cb2713d681 /cmake/QtBaseGlobalTargets.cmake | |
parent | 94dcb5454f0f8f144568dff7a9dd1316046ee197 (diff) |
CMake: Fix standalone tests to work properly on reconfiguration
And also fix qt-cmake-standalone-test to work for prefix builds.
The gist of it is that we have to protect tests not to be installed
into the Qt install prefix, but we also have to make sure that the
CMAKE_INSTALL_PREFIX is not changed globally (via cache value),
so that reconfiguration still works.
This took way too long to figure out.
Amends d6272d774c7415186aa398e59f234d0073458072
Fixes: QTBUG-84346
Change-Id: I18c29574c9957fe05b86f701c8c14ec07e0f045b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake/QtBaseGlobalTargets.cmake')
-rw-r--r-- | cmake/QtBaseGlobalTargets.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 366b23c6c1..d37c7f1cc0 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -211,6 +211,14 @@ set(__qt_cmake_private_path "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private") set(__qt_cmake_standalone_test_path "${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}") + +if(QT_WILL_INSTALL) + # Need to prepend the install prefix when doing prefix builds, because the build internals + # install dir is relative in that case.. + qt_path_join(__qt_cmake_standalone_test_path + "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}" + "${__qt_cmake_standalone_test_path}") +endif() if(UNIX) string(PREPEND __qt_cmake_private_path "exec ") set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"") |