aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Kauffmann <johanneskauffmann@hotmail.com>2022-10-26 01:32:52 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-28 00:49:15 +0000
commit0c0abe8dffdd29725e0ef3175c834fd5eec49957 (patch)
tree4f87c056b100345a3d6d8a244b03c92fc3c5e8cf
parent3c761b5bb0e099f4b875ecf363820e4c756e9e58 (diff)
CMake: fix configuring with -no-feature-testlib
Without the Qt::Test target: - the QuickControlsTestUtilsPrivate target could never be configured correctly, because it depends on Qt::Test. - a CMake error would be thrown, because the find_package() call which searches for Qt::Test considered Qt::Test a required component. This, of course, doesn't have to be the case. Change-Id: I0db912352e83faefbfda448f21527908c7f4cf9d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 1214c070578b1b80b2ed2128e4e9145adb7dbd2b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/CMakeLists.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 71d6b0d910..c05788e090 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,8 +28,8 @@ if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)
add_subdirectory(quick)
add_subdirectory(quicklayouts)
- find_package(Qt6 ${PROJECT_VERSION} CONFIG COMPONENTS Test) # special case
- if(QT_FEATURE_testlib AND TARGET Qt::Test) # special case
+ find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Test)
+ if(QT_FEATURE_testlib AND TARGET Qt::Test)
add_subdirectory(qmltest)
add_subdirectory(quicktestutils)
endif()
@@ -52,7 +52,7 @@ if(TARGET Qt::Gui AND TARGET Qt::qsb AND QT_FEATURE_qml_animation)
add_subdirectory(quickdialogs2)
add_subdirectory(quicknativestyle)
- if(TARGET Qt::QuickControls2)
+ if(QT_FEATURE_testlib AND TARGET Qt::Test AND TARGET Qt::QuickControls2)
add_subdirectory(quickcontrolstestutils)
endif()
else()