summaryrefslogtreecommitdiffstats
path: root/cmake/QtModuleDependencies.cmake.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-08-12 19:12:13 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-08-13 19:45:29 +0200
commit9e044765ec88ee32781278f44a25746744dd48ec (patch)
tree557d6a10c0a5b22e2c7f045f85498d0ec2803871 /cmake/QtModuleDependencies.cmake.in
parent707d29d5d7824063c6dd84295cc82636444e6d6a (diff)
CMake: Fix empty value of CMAKE_SIZEOF_VOID_P when looking for tools
Our initial approach to looking for host Qt tools when cross-compiling to a platform with a different architecture bitness compared to the host one was to unset CMAKE_SIZEOF_VOID_P before calling find_package(Qt6FooTools) and then restoring the value. That works to bypass the architecture bitness test in the ConfigVersion files, but it also influences the paths that find_package() searches in, specifically the lib<arch> paths like /usr/lib64 will not be searched in. Fortunately since CMake 3.14, write_basic_package_version_file() can take an additional ARCH_INDEPENDENT parameter. This disables the architecture bitness test when looking for the package, while allowing to still search in the /usr/lib64 like paths. Use it when creating the QtFooToolConfigVersion.cmake files. One could argue we should actually check if the tool executables could run on the host system where find_package is called for cross-compilation. We could do that in another change if the problem ever arises. Amends 03aa74e40d8f1270e1bb28d0791e5bc376ffa0b7 Amends 914b367c7f6a117130b8a56338c46a8102a1f77f Change-Id: I1181ff637ac80064a6a8538170b28a41743fc90c Fixes: QTBUG-81672 Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtModuleDependencies.cmake.in')
-rw-r--r--cmake/QtModuleDependencies.cmake.in7
1 files changed, 0 insertions, 7 deletions
diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in
index 56819f8816..d598571d64 100644
--- a/cmake/QtModuleDependencies.cmake.in
+++ b/cmake/QtModuleDependencies.cmake.in
@@ -35,11 +35,6 @@ endforeach()
# Find Qt tool package.
set(_tool_deps "@main_module_tool_deps@")
-# The tools do not provide linkage targets but executables, where a mismatch
-# between 32-bit target and 64-bit host does not matter.
-set(BACKUP_@target@_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
-set(CMAKE_SIZEOF_VOID_P "")
-
if(QT_HOST_PATH)
# Make sure that the tools find the host tools first
set(BACKUP_@target@_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
@@ -56,7 +51,6 @@ foreach(_target_dep ${_tool_deps})
if (NOT ${pkg}_FOUND)
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
- set(CMAKE_SIZEOF_VOID_P "${BACKUP_@target@_CMAKE_SIZEOF_VOID_P}")
if(QT_HOST_PATH)
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
@@ -68,7 +62,6 @@ if(QT_HOST_PATH)
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
endif()
-set(CMAKE_SIZEOF_VOID_P "${BACKUP_@target@_CMAKE_SIZEOF_VOID_P}")
# note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0"
set(_target_deps "@target_deps@")