summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2023-08-18 15:48:21 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2023-08-23 16:21:58 +0200
commitb6849849392cf14ead014833976d1926504985d2 (patch)
treeea1ead1865e73fa9a12c91bc0162f88098955a3c /CMakeLists.txt
parentf081578ce097e5b437a0b1beee84f7056e9099f8 (diff)
CMake: Fix find_package(Qt6*Tools) in non-qtbase tests
Tests in non-qtbase modules could not find_package their own Qt6*Tools packages, because add_subdirectory(tests) was called before the config files for Qt6*Tools were created. The creation of tools config files is done in QtPostProcess.cmake, which was included in qt_build_repo_end(). Move that include into its own macro, qt_build_repo_post_process() and remove it from qt_build_repo_end(). Call qt_build_repo_post_process() before the 'tests' directory is added in qt_build_repo(). Every call site of qt_build_repo_end() must now be adjusted and call qt_build_repo_post_process(). Task-number: QTBUG-88264 Change-Id: I80d60a1b5c0e9b715c298ef4934b562f815432d1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e38001cc6..a0da025418 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,13 +177,6 @@ if(NOT QT_BUILD_STANDALONE_TESTS)
add_subdirectory(src)
endif()
-if(QT_BUILD_TESTS)
- add_subdirectory(tests)
- if(NOT QT_BUILD_TESTS_BY_DEFAULT)
- set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
- endif()
-endif()
-
if(NOT QT_BUILD_STANDALONE_TESTS)
if(QT_WILL_BUILD_TOOLS AND QT_FEATURE_settings)
add_subdirectory(qmake)
@@ -208,6 +201,15 @@ if(NOT QT_BUILD_STANDALONE_TESTS)
endforeach()
endif()
+qt_build_repo_post_process()
+
+if(QT_BUILD_TESTS)
+ add_subdirectory(tests)
+ if(NOT QT_BUILD_TESTS_BY_DEFAULT)
+ set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
+ endif()
+endif()
+
qt_build_repo_end()
if(NOT QT_BUILD_STANDALONE_TESTS AND QT_BUILD_EXAMPLES)