summaryrefslogtreecommitdiffstats
path: root/cmake/QtModuleToolsConfig.cmake.in
diff options
context:
space:
mode:
authorAlexandru Croitor <[email protected]>2025-11-17 19:07:03 +0100
committerAlexandru Croitor <[email protected]>2025-11-27 15:22:48 +0100
commit7e36a23467e3572a282a76cb1e2319f53499fed9 (patch)
tree2ddd8a0c887367a8b9998fe46df54ea28a422702 /cmake/QtModuleToolsConfig.cmake.in
parentb0f25bc6a7c40b36b6cab4f53d2ef44f1b6d4632 (diff)
CMake: Allow creating a standalone Tools package without a module
Add a new qt_internal_add_tools_package function to allow creating a standalone Tools cmake package. It can be useful for a repo which might build e.g. an arch-independent java tool exposed by an IMPORTED executable, but has no associated C++ Qt module. Also add a qt_internal_record_tools_package_extra_third_party_dependency function to allow looking up additional third party cmake packages when finding the tool package. Change-Id: I46f5fb9f7a361ecf4018f0fc1ed0a1f8ecf12df3 Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'cmake/QtModuleToolsConfig.cmake.in')
-rw-r--r--cmake/QtModuleToolsConfig.cmake.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmake/QtModuleToolsConfig.cmake.in b/cmake/QtModuleToolsConfig.cmake.in
index 43b826c2060..1bd54239edf 100644
--- a/cmake/QtModuleToolsConfig.cmake.in
+++ b/cmake/QtModuleToolsConfig.cmake.in
@@ -18,10 +18,17 @@ if(NOT DEFINED "@INSTALL_CMAKE_NAMESPACE@@target@_FOUND")
set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" TRUE)
endif()
+set(__qt_@target@_should_include_targets_code "@QT_SHOULD_INCLUDE_TARGETS_CODE@")
+
# Do the checks inside Targets.cmake even when the file is still being generated
-include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
+if(__qt_@target@_should_include_targets_code)
+ include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@[email protected]")
+endif()
-if(NOT __qt_@target@_skip_include_targets_file AND @INSTALL_CMAKE_NAMESPACE@@target@_FOUND)
+if(NOT __qt_@target@_skip_include_targets_file
+ AND @INSTALL_CMAKE_NAMESPACE@@target@_FOUND
+ AND __qt_@target@_should_include_targets_code
+ )
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)
@@ -30,7 +37,8 @@ if(NOT __qt_@target@_skip_include_targets_file AND @INSTALL_CMAKE_NAMESPACE@@tar
set(__qt_@target@_targets_file_included ON)
endif()
-foreach(extra_cmake_include @extra_cmake_includes@)
+set(__qt_@target@_extra_cmake_includes "@extra_cmake_includes@")
+foreach(extra_cmake_include IN LISTS __qt_@target@_extra_cmake_includes)
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}")
endforeach()