summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexandru Croitor <[email protected]>2025-06-12 12:16:57 +0200
committerAlexandru Croitor <[email protected]>2025-06-17 16:47:16 +0200
commitf1a59e974f013fcf8629d8cbacab58d895523100 (patch)
treefc17ca34fa11bc3d4690a8d5f7d06c3986d16ccc /tests
parent027894b84b2544c1e944b856045e22c3167e721d (diff)
CMake: Annotate some qt_find_package calls with MODULE
A qt_find_package call first tries to find a Config package with the CONFIG mode option, and if not found, falls back to an arg-less mode which searches both Config and Find modules. For some packages, we know we want to find the Find module because there can't be a Config package, e.g our FindWrap modules or any of the other Find modules we carry in our cmake directory. So we should annotate these calls with MODULE. Aside from slightly faster configuration, there is another reason to do so. Future versions of CMake will automatically log find_package calls that have a state change (e.g. Not Found -> Found) into CMakeConfigureLog.yaml. Due to the Config-first logic in qt_find_package, we always unset the Foo_DIR variable if the Config package is not found. This means that there will be a constant build up of not-found messages in the log. Explicitly annotating the calls with MODULE will prevent this. Do that. Pick-to: 6.10 Change-Id: I465b015ac18f8a09b9a5c86cec7b6312a0bfbdf1 Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt6
-rw-r--r--tests/manual/xembed/gtk-container/CMakeLists.txt4
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 78192ce6ff2..968cbfa58e5 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,9 +14,9 @@ if(QT_BUILD_STANDALONE_TESTS)
# are handled by qt_enable_cmake_languages().
qt_internal_set_up_config_optimizations_like_in_qmake()
- qt_find_package(WrapDBus1 PROVIDED_TARGETS dbus-1)
+ qt_find_package(WrapDBus1 MODULE PROVIDED_TARGETS dbus-1)
qt_find_package(ICU 50.1 COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data)
- qt_find_package(WrapOpenSSL PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL)
- qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders)
+ qt_find_package(WrapOpenSSL MODULE PROVIDED_TARGETS WrapOpenSSL::WrapOpenSSL)
+ qt_find_package(WrapOpenSSLHeaders MODULE PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders)
endif()
qt_build_tests()
diff --git a/tests/manual/xembed/gtk-container/CMakeLists.txt b/tests/manual/xembed/gtk-container/CMakeLists.txt
index 34a802c1426..88373d99cd5 100644
--- a/tests/manual/xembed/gtk-container/CMakeLists.txt
+++ b/tests/manual/xembed/gtk-container/CMakeLists.txt
@@ -1,8 +1,8 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-qt_find_package(GTK3)
-qt_find_package(X11)
+qt_find_package(GTK3 MODULE)
+qt_find_package(X11 MODULE)
#####################################################################
## gtk-container Binary: