From e957e9c28ffc490b27f569e2b24b007a586c76f0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 15 Sep 2020 11:51:59 +0200 Subject: CMake: Fix incorrect host path used in generated toolchain file A previous change accidentally broke what we we set for QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR. The QT_HOST_PATH variable should use an absolute path as it was done before. The QT_HOST_PATH_CMAKE_DIR variable incorrectly used the value of "${QT_HOST_PATH}" instead of "${QT_HOST_PATH_CMAKE_DIR}". Fix both of these, and change the names of intermediate variables to be consistent. Amends a6a3b82ffb3d7f1ea13293206401ed360a51e9cd Task-number: QTBUG-85240 Change-Id: I328a7edee12a13ff793684e8a0a4c2e03204eca4 Reviewed-by: Qt CI Bot Reviewed-by: Joerg Bornemann --- cmake/QtBaseGlobalTargets.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cmake/QtBaseGlobalTargets.cmake') diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index de3c1af434..b482c3079f 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -92,18 +92,20 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS # Generate toolchain file for convenience if(QT_HOST_PATH) - get_filename_component(init_qt_host_path "${QT_HOST_PATH}" ABSOLUTE) # TODO: Figure out how to make these relocatable. + + get_filename_component(__qt_host_path_absolute "${QT_HOST_PATH}" ABSOLUTE) set(init_qt_host_path " -set(__qt_initial_qt_host_path \"${QT_HOST_PATH}\") +set(__qt_initial_qt_host_path \"${__qt_host_path_absolute}\") if(NOT DEFINED QT_HOST_PATH AND EXISTS \"\${__qt_initial_qt_host_path}\") set(QT_HOST_PATH \"\${__qt_initial_qt_host_path}\" CACHE PATH \"\" FORCE) endif()") - get_filename_component(QT_HOST_PATH_CMAKE_DIR + + get_filename_component(__qt_host_path_cmake_dir_absolute "${Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR}/.." ABSOLUTE) set(init_qt_host_path_cmake_dir " -set(__qt_initial_qt_host_path_cmake_dir \"${QT_HOST_PATH}\") +set(__qt_initial_qt_host_path_cmake_dir \"${__qt_host_path_cmake_dir_absolute}\") if(NOT DEFINED QT_HOST_PATH_CMAKE_DIR AND EXISTS \"\${__qt_initial_qt_host_path_cmake_dir}\") set(QT_HOST_PATH_CMAKE_DIR \"\${__qt_initial_qt_host_path_cmake_dir}\" CACHE PATH \"\" FORCE) endif()") -- cgit v1.2.3