Skip to content

Commit a67c13d

Browse files
committed
Make the HostInfo package lookup properly versioned
Avoid hardcoding the HostInfo package version, use the INSTALL_CMAKE_NAMESPACE as the reference for the find_package calls. If we assume that the package follows the versioning in the future, we should consider the Qt version, to avoid any version related issues. Pick-to: 6.5 6.8 6.9 Change-Id: If84550ab82f8de51ff5af41c7f31838c4ed53a67 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
1 parent 276ccda commit a67c13d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

cmake/QtBuildHelpers.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ endfunction()
361361

362362
macro(qt_internal_setup_find_host_info_package)
363363
_qt_internal_determine_if_host_info_package_needed(__qt_build_requires_host_info_package)
364-
_qt_internal_find_host_info_package("${__qt_build_requires_host_info_package}")
364+
_qt_internal_find_host_info_package("${__qt_build_requires_host_info_package}"
365+
${INSTALL_CMAKE_NAMESPACE})
365366
endmacro()
366367

367368
macro(qt_internal_setup_poor_mans_scope_finalizer)
@@ -489,4 +490,3 @@ macro(qt_internal_setup_build_and_global_variables)
489490

490491
qt_internal_detect_dirty_features()
491492
endmacro()
492-

cmake/QtConfigDependencies.cmake.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ _qt_internal_setup_qt_host_path(
1717
"${__qt_platform_requires_host_info_package}"
1818
"${__qt_platform_initial_qt_host_path}"
1919
"${__qt_platform_initial_qt_host_path_cmake_dir}")
20-
_qt_internal_find_host_info_package(${__qt_platform_requires_host_info_package})
20+
_qt_internal_find_host_info_package(${__qt_platform_requires_host_info_package}
21+
@INSTALL_CMAKE_NAMESPACE@)
2122

2223
# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;"
2324
set(__qt_third_party_deps "@third_party_deps@")

cmake/QtPublicDependencyHelpers.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ function(_qt_internal_determine_if_host_info_package_needed out_var)
239239
set(${out_var} "${needed}" PARENT_SCOPE)
240240
endfunction()
241241

242-
macro(_qt_internal_find_host_info_package platform_requires_host_info)
242+
macro(_qt_internal_find_host_info_package platform_requires_host_info install_namespace)
243243
if(${platform_requires_host_info})
244-
find_package(Qt6HostInfo
244+
find_package(${install_namespace}HostInfo
245245
CONFIG
246246
REQUIRED
247247
PATHS "${QT_HOST_PATH}"

0 commit comments

Comments
 (0)