summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <[email protected]>2025-03-17 17:54:32 +0100
committerAlexey Edelev <[email protected]>2025-03-21 12:55:49 +0100
commit56ec6b4843ff1e3763ad9cb608acfb21ea4db341 (patch)
treef66b032d57c34da8a2f00fa0a33d2b1682f1cff5
parenta67c13d1a68db40d1c2e9f89bcc76aa244feb8d0 (diff)
Avoid using the PROJECT_VERSION when accessing the HostInfo package variables
The related functionality meant to be enabled by BuildInternals, which makes the lookup of the pre-defined HostInfo version based on either calculated or pre-defined INSTALL_CMAKE_NAMESPACE. The PROJECT_VESION(_MAJOR) meanwhile is hardcoded by the current Qt repo, which is not necessary aligned with BuildInternals/HostInfo. Pick-to: 6.5 6.8 6.9 Change-Id: I61052c93ce2d6ee3c6d8025da2e078edcde48d0d Reviewed-by: Alexandru Croitor <[email protected]>
-rw-r--r--cmake/QtConfig.cmake.in2
-rw-r--r--cmake/QtPostProcessHelpers.cmake2
-rw-r--r--cmake/QtToolHelpers.cmake6
3 files changed, 5 insertions, 5 deletions
diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in
index e6810e71f3a..d1ffc7456b9 100644
--- a/cmake/QtConfig.cmake.in
+++ b/cmake/QtConfig.cmake.in
@@ -150,7 +150,7 @@ foreach(module ${__qt_umbrella_find_components})
# But don't match QtShaderTools and QtTools which are cross-compiled target package names.
# Allow opt out just in case.
get_filename_component(__qt_find_package_host_qt_path
- "${Qt@PROJECT_VERSION_MAJOR@HostInfo_DIR}/.." ABSOLUTE)
+ "${@INSTALL_CMAKE_NAMESPACE@HostInfo_DIR}/.." ABSOLUTE)
set(__qt_backup_cmake_prefix_path "${CMAKE_PREFIX_PATH}")
set(__qt_backup_cmake_find_root_path "${CMAKE_FIND_ROOT_PATH}")
list(PREPEND CMAKE_PREFIX_PATH "${__qt_find_package_host_qt_path}"
diff --git a/cmake/QtPostProcessHelpers.cmake b/cmake/QtPostProcessHelpers.cmake
index d57f68f09a4..180c207c7a2 100644
--- a/cmake/QtPostProcessHelpers.cmake
+++ b/cmake/QtPostProcessHelpers.cmake
@@ -432,7 +432,7 @@ endif()")
# to the target CMAKE_INSTALL_DIR, if at all possible to do so in a reliable way.
get_filename_component(qt_host_path_absolute "${QT_HOST_PATH}" ABSOLUTE)
get_filename_component(qt_host_path_cmake_dir_absolute
- "${Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR}/.." ABSOLUTE)
+ "${${INSTALL_CMAKE_NAMESPACE}HostInfo_DIR}/.." ABSOLUTE)
endif()
if(third_party_deps OR platform_requires_host_info_package)
diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake
index 22e083b1208..a7e1842c04f 100644
--- a/cmake/QtToolHelpers.cmake
+++ b/cmake/QtToolHelpers.cmake
@@ -712,14 +712,14 @@ function(qt_internal_find_tool out_var target_name tools_target)
set(${tools_package_name}_BACKUP_CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}")
if(QT_HOST_PATH_CMAKE_DIR)
set(qt_host_path_cmake_dir_absolute "${QT_HOST_PATH_CMAKE_DIR}")
- elseif(Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR)
+ elseif(${INSTALL_CMAKE_NAMESPACE}HostInfo_DIR)
get_filename_component(qt_host_path_cmake_dir_absolute
- "${Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR}/.." ABSOLUTE)
+ "${${INSTALL_CMAKE_NAMESPACE}HostInfo_DIR}/.." ABSOLUTE)
else()
# This should never happen, serves as an assert.
message(FATAL_ERROR
"Neither QT_HOST_PATH_CMAKE_DIR nor "
- "Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR available.")
+ "${INSTALL_CMAKE_NAMESPACE}HostInfo_DIR available.")
endif()
set(CMAKE_PREFIX_PATH "${qt_host_path_cmake_dir_absolute}")