summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <[email protected]>2023-03-07 14:23:29 +0100
committerQt Cherry-pick Bot <[email protected]>2023-03-13 15:12:41 +0000
commit32bfaecb3225609daa75bc15fe391112c18e32d6 (patch)
tree8b779f4ddeeb6fcebe4ade3457f0ded609a4d3d8
parentb01afb004afae8b53b7163108026b4787a9162ba (diff)
Make sure that all dependencies are found before creating tool targets
The result of dependency lookup is not taken into account when evaluating tool packages. Check for <ToolPackage>_FOUND before creating the tool targets that belong to the tool package. Adjust the tool package lookup that the dependencies always affect the lookup result even if we avoided creating targets by setting QT_NO_CREATE_TARGETS. Change-Id: Ia95c9c71370becc639ed8a9db026aed2f93959b4 Reviewed-by: Alexandru Croitor <[email protected]> (cherry picked from commit 5e4f4816a89673a2501abc458b28365bcf103c47) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r--cmake/QtModuleToolsConfig.cmake.in16
1 files changed, 11 insertions, 5 deletions
diff --git a/cmake/QtModuleToolsConfig.cmake.in b/cmake/QtModuleToolsConfig.cmake.in
index fdbc8536464..4d852dc98e1 100644
--- a/cmake/QtModuleToolsConfig.cmake.in
+++ b/cmake/QtModuleToolsConfig.cmake.in
@@ -4,12 +4,18 @@ cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_versio
include(CMakeFindDependencyMacro)
-if (NOT QT_NO_CREATE_TARGETS)
- # Find required dependencies, if any.
- if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
- include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
- endif()
+# Find required dependencies, if any.
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
+ include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
+endif()
+
+# If *Dependencies.cmake exists, the variable value will be defined there.
+# Don't override it in that case.
+if(NOT DEFINED "@INSTALL_CMAKE_NAMESPACE@@target@_FOUND")
+ set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" TRUE)
+endif()
+if (NOT QT_NO_CREATE_TARGETS AND @INSTALL_CMAKE_NAMESPACE@@target@_FOUND)
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
if(NOT QT_NO_CREATE_VERSIONLESS_TARGETS)