diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-07 19:04:29 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-09-17 11:25:12 +0200 |
commit | 026e09cab52394be3bd8a075cca5fbc697d7819e (patch) | |
tree | adfbb6cc0c5512963a07bd03b5b6c9e00ada4ac3 /tests | |
parent | dd0736d681d7a115d539cda7a6aea327b3c9b465 (diff) |
CMake: Fix tests to check for targets in a repo-target-set build
When building qtscxml repo target sets one by one, and including the
repo-target-set specific TestsConfig.cmake files as part of a
standalone test build, certain targets might not exist.
Guard them with TARGET checks.
Pick-to: 6.2
Task-number: QTBUG-96253
Change-Id: I6dd30b96919c6090934be14604cbad1bf965c514
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/CMakeLists.txt | 19 | ||||
-rw-r--r-- | tests/auto/qml/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/qmltest/CMakeLists.txt | 9 |
3 files changed, 24 insertions, 15 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 6e10a28..6cf8243 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,15 +1,18 @@ add_subdirectory(scxmlcoutput) -if (TARGET Qt::Gui AND TARGET Qt::Qml) - add_subdirectory(compiled) - add_subdirectory(dynamicmetaobject) - add_subdirectory(parser) - add_subdirectory(scion) - add_subdirectory(statemachine) - add_subdirectory(statemachineinfo) +if(TARGET Qt::Gui AND TARGET Qt::Qml) + if(TARGET Qt::Scxml) + add_subdirectory(compiled) + add_subdirectory(dynamicmetaobject) + add_subdirectory(parser) + add_subdirectory(scion) + add_subdirectory(statemachine) + add_subdirectory(statemachineinfo) + endif() + # More checks inside add_subdirectory(qml) add_subdirectory(qmltest) endif() -if(NOT UIKIT) +if(NOT UIKIT AND TARGET Qt::StateMachine) add_subdirectory(qstatemachine) endif() diff --git a/tests/auto/qml/CMakeLists.txt b/tests/auto/qml/CMakeLists.txt index 0a867bb..23c8022 100644 --- a/tests/auto/qml/CMakeLists.txt +++ b/tests/auto/qml/CMakeLists.txt @@ -1,4 +1,7 @@ - -add_subdirectory(qqmlstatemachine) -add_subdirectory(qqmlstatemachinemetatype) -add_subdirectory(scxmlqmlcpp) +if(TARGET Qt::StateMachineQml) + add_subdirectory(qqmlstatemachine) + add_subdirectory(qqmlstatemachinemetatype) +endif() +if(TARGET Qt::ScxmlQml) + add_subdirectory(scxmlqmlcpp) +endif() diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt index c1a2719..0f60ab6 100644 --- a/tests/auto/qmltest/CMakeLists.txt +++ b/tests/auto/qmltest/CMakeLists.txt @@ -1,3 +1,6 @@ - -add_subdirectory(statemachine) -add_subdirectory(scxml) +if(TARGET Qt::StateMachineQml) + add_subdirectory(statemachine) +endif() +if(TARGET Qt::ScxmlQml) + add_subdirectory(scxml) +endif() |