Skip to content

Commit

Permalink
Adopt the Qt dependencies lookup mechanism for tools dependencies
Browse files Browse the repository at this point in the history
The existing lookup mechanism doesn't consider Qt path when looking for
the Qt Tool package dependencies. In good scenario this leads to the
missing Qt Tool package, in worst case scenario the Tool package could
be found by alternative search path and attempt using the invalid
tools.

Use the lookup functionality we have for Qt modules when looking for
dependencies of the Qt tools. This will look the tools in Qt search
paths first and only then attempt looking elsewhere, considering the
QT_HOST_PATH.

Pick-to: 6.5 6.8 6.9
Fixes: QTBUG-132340
Change-Id: I570c03037f2a92922d2546a4f5fde1bc17a7f812
Reviewed-by: Alexandru Croitor <[email protected]>
  • Loading branch information
semlanik committed Jan 3, 2025
1 parent 96bb0db commit 035fbd0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions cmake/QtModuleToolsDependencies.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@
# SPDX-License-Identifier: BSD-3-Clause

# Find "ModuleTools" dependencies, which are other ModuleTools packages.
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
set(__qt_@target@_tool_deps "@package_deps@")
foreach(__qt_@target@_target_dep ${__qt_@target@_tool_deps})
list(GET __qt_@target@_target_dep 0 __qt_@target@_pkg)
list(GET __qt_@target@_target_dep 1 __qt_@target@_version)

if (NOT ${__qt_@target@_pkg}_FOUND)
find_dependency(${__qt_@target@_pkg} ${__qt_@target@_version})
endif()
endforeach()

set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND TRUE)

set(__qt_@target@_tool_deps "@package_deps@")
_qt_internal_find_tool_dependencies("@target@" __qt_@target@_tool_deps)

0 comments on commit 035fbd0

Please sign in to comment.