From 5e0129f63cbd45767342c43135f6061750511e33 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 20 Jul 2020 17:12:45 +0200 Subject: CMake: Fix configuration of CMake tests in-build-tree Qt6 package was not found the tests were configured in-tree as opposed to standalone tests. Use the same trick we do for building examples in-tree. Specify the path to the build tree packages, and don't create targets. Amends 96e3ee06598d00e7155f3f8574759ea658a134e5 Change-Id: Ia60de416ce0afff5bd40be8c0c6e3c7898fd7ebf Reviewed-by: Cristian Adam --- tests/auto/cmake/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/cmake/CMakeLists.txt') diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index b270ab4eda..1ad56e1adc 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -60,6 +60,11 @@ set(required_packages Core Network Xml Sql Test) set(optional_packages DBus Gui Widgets PrintSupport OpenGL Concurrent) # Setup the test when called as a completely standalone project. +if(TARGET Qt6::Core) + # Tests are built as part of the qtbase build tree. + # Setup paths so that the Qt packages are found, similar to examples. + qt_internal_set_up_build_dir_package_paths() +endif() find_package(Qt6 REQUIRED COMPONENTS ${required_packages}) find_package(Qt6 OPTIONAL_COMPONENTS ${optional_packages}) -- cgit v1.2.3