summaryrefslogtreecommitdiffstats
path: root/cmake/QtModuleDependencies.cmake.in
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2020-12-15 18:09:32 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2020-12-21 13:41:13 +0100
commit56bdef94379479f27858dccc73a95614648735bb (patch)
tree3ad5f8f1a3fd2fc57486a42e01ce589f17e1c858 /cmake/QtModuleDependencies.cmake.in
parent50f939bfe8bdd63beca4aff06cbf1b2be1677624 (diff)
CMake: Use host variables instead of hardcoded directories
'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Pick-to: 6.0 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf 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.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in
index 01cf9d5b3c..8f7960059a 100644
--- a/cmake/QtModuleDependencies.cmake.in
+++ b/cmake/QtModuleDependencies.cmake.in
@@ -43,7 +43,7 @@ endforeach()
# Find Qt tool package.
set(_tool_deps "@main_module_tool_deps@")
-if(QT_HOST_PATH)
+if(NOT "${QT_HOST_PATH}" STREQUAL "")
# Make sure that the tools find the host tools first
set(BACKUP_@target@_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
set(BACKUP_@target@_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
@@ -64,14 +64,14 @@ foreach(_target_dep ${_tool_deps})
endif()
find_package(${pkg} ${version} ${find_package_args})
if (NOT ${pkg}_FOUND)
- if(QT_HOST_PATH)
+ if(NOT "${QT_HOST_PATH}" STREQUAL "")
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
endif()
return()
endif()
endforeach()
-if(QT_HOST_PATH)
+if(NOT "${QT_HOST_PATH}" STREQUAL "")
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
endif()