summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-24 14:56:15 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-24 14:23:32 +0000
commit03aa74e40d8f1270e1bb28d0791e5bc376ffa0b7 (patch)
tree52dbda39588283b779fdc9f95aa575d25889a42c /cmake
parenta39a0e5419b6b23721ee847f32d9668eb3c2220a (diff)
Fix tools dependencies lookup when cross-compiling
When the host system uses 64-bits for pointers and the target 32-bits, then locating the tools dependencies would fail due to the mismatch. Since the tools dependencies don't create linkable targets but merely import executables, we can skip this check like in commit 914b367c7f6a117130b8a56338c46a8102a1f77f. Change-Id: I1ebd0867e4cce34f42df21dc8e8d9176a83a9cac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtModuleDependencies.cmake.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in
index e6855de528..b4f27ba85c 100644
--- a/cmake/QtModuleDependencies.cmake.in
+++ b/cmake/QtModuleDependencies.cmake.in
@@ -34,6 +34,12 @@ set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}")
# 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_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
+set(CMAKE_SIZEOF_VOID_P "")
+
foreach(_target_dep ${_tool_deps})
list(GET _target_dep 0 pkg)
list(GET _target_dep 1 version)
@@ -42,9 +48,11 @@ foreach(_target_dep ${_tool_deps})
if (NOT ${pkg}_FOUND)
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
+ set(CMAKE_SIZEOF_VOID_P "${BACKUP_CMAKE_SIZEOF_VOID_P}")
return()
endif()
endforeach()
+set(CMAKE_SIZEOF_VOID_P "${BACKUP_CMAKE_SIZEOF_VOID_P}")
# note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0"
set(_target_deps "@target_deps@")