summaryrefslogtreecommitdiffstats
path: root/cmake/QtToolHelpers.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-01-11 17:44:10 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-02-15 14:48:20 +0100
commite044c94a61f0cd2bdea1e89be4ec3c68007f7a5c (patch)
tree8b8b522b0a69a2693c263385565651947b824264 /cmake/QtToolHelpers.cmake
parentd08f59d083c0d915bbd0d74972ee380763447f3d (diff)
CMake: Introduce QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH
When installing conan packages we have one installation prefix per package. When cross-building a conan package, we need to make known those multiple host prefixes to Qt, analogous to QT_ADDITIONAL_PACKAGES_PREFIX_PATH. Pick-to: 6.2 6.3 Fixes: QTBUG-94524 Change-Id: I68cbede350f95266a5fd3559e9b9c214c5858eed Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtToolHelpers.cmake')
-rw-r--r--cmake/QtToolHelpers.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/QtToolHelpers.cmake b/cmake/QtToolHelpers.cmake
index 86621f4871..a687ff2b84 100644
--- a/cmake/QtToolHelpers.cmake
+++ b/cmake/QtToolHelpers.cmake
@@ -123,6 +123,19 @@ function(qt_internal_add_tool target_name)
"Neither QT_HOST_PATH_CMAKE_DIR nor "
"Qt${PROJECT_VERSION_MAJOR}HostInfo_DIR} available.")
endif()
+
+ # Look for tools in additional host Qt installations. This is done for conan support where
+ # we have separate installation prefixes per package. For simplicity, we assume here that
+ # all host Qt installations use the same value of INSTALL_LIBDIR.
+ if(DEFINED QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH)
+ file(RELATIVE_PATH rel_host_cmake_dir "${QT_HOST_PATH}" "${QT_HOST_PATH_CMAKE_DIR}")
+ foreach(host_path IN LISTS QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH)
+ set(host_cmake_dir "${host_path}/${rel_host_cmake_dir}")
+ list(PREPEND CMAKE_PREFIX_PATH "${host_cmake_dir}")
+ endforeach()
+
+ list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_ADDITIONAL_HOST_PACKAGES_PREFIX_PATH}")
+ endif()
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_HOST_PATH}")
find_package(