From 7f1e145f7ee885d8c6b29d02206711040b65f6f6 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 23 Nov 2020 14:15:04 +0100 Subject: [PATCH] CMake: Restore QT_STAGING_PREFIX in qt-cmake-standalone-test generation Restore 'QT_STAGING_PREFIX' logic when generating 'qt-cmake-standalone-test'. Relative paths now calculating depend on 'QT_STAGING_PREFIX'. For prefix builds QT_STAGING_PREFIX should be prepend to '__qt_cmake_standalone_test_path' Fixes: QTBUG-88764 Pick-to: 6.0 Change-Id: I655c60847f2ab872948cfe9aedc27835e5cc4fb5 Reviewed-by: Alexandru Croitor --- cmake/QtWrapperScriptHelpers.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cmake/QtWrapperScriptHelpers.cmake b/cmake/QtWrapperScriptHelpers.cmake index b1ae09262cd..63cb7701311 100644 --- a/cmake/QtWrapperScriptHelpers.cmake +++ b/cmake/QtWrapperScriptHelpers.cmake @@ -70,17 +70,26 @@ function(qt_internal_create_wrapper_scripts) set(__qt_cmake_standalone_test_bin_name "qt-cmake-standalone-test") set(__qt_cmake_standalone_test_bin_path "${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}") + set(__qt_cmake_private_path + "${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private") set(__qt_cmake_standalone_test_path "${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}") get_filename_component(rel_base_path - "${CMAKE_INSTALL_PREFIX}/${__qt_cmake_standalone_test_bin_path}" + "${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_bin_path}" DIRECTORY) + if(QT_WILL_INSTALL) + # Need to prepend the staging 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_STAGING_PREFIX}" + "${__qt_cmake_standalone_test_path}") + endif() file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}" - "${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private") + "${__qt_cmake_private_path}") file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}" - "${CMAKE_INSTALL_PREFIX}/${__qt_cmake_standalone_test_path}") + "${__qt_cmake_standalone_test_path}") if(CMAKE_HOST_UNIX) set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")