summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-08-17 17:03:25 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-08-19 16:42:56 +0200
commitd65ccd399929ae51f192655f23b521904767bbcf (patch)
treec3194226c866cd92222bcf08b9256a0aa1ba43ee /cmake
parent5c4861d312110986b8ba31b88f71174553e71d69 (diff)
CMake: Don't backup cmake prefix when there are no tool dependencies
This is just a minor optimization. Pick-to: 6.2 Change-Id: Icf0fc615895e1def63c57a72694c89f7ae7ee5cf Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtModuleDependencies.cmake.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in
index 7f0f00fdf5..eb967c597f 100644
--- a/cmake/QtModuleDependencies.cmake.in
+++ b/cmake/QtModuleDependencies.cmake.in
@@ -49,7 +49,7 @@ endforeach()
# Find Qt tool package.
set(__qt_@target@_tool_deps "@main_module_tool_deps@")
-if(NOT "${QT_HOST_PATH}" STREQUAL "")
+if(__qt_@target@_tool_deps AND 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})
@@ -81,7 +81,7 @@ foreach(__qt_@target@_target_dep ${__qt_@target@_tool_deps})
return()
endif()
endforeach()
-if(NOT "${QT_HOST_PATH}" STREQUAL "")
+if(__qt_@target@_tool_deps AND 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()