From 03aa74e40d8f1270e1bb28d0791e5bc376ffa0b7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 24 Jun 2019 14:56:15 +0200 Subject: [PATCH] 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 --- cmake/QtModuleDependencies.cmake.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index e6855de5285..b4f27ba85c7 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@")