diff options
Diffstat (limited to 'kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch')
| -rw-r--r-- | kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch new file mode 100644 index 00000000000..f9eef600724 --- /dev/null +++ b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.93.0-skip-ecm_add_test-early.patch @@ -0,0 +1,57 @@ +From 9b53dd107af153b88658ffa246de728a8a6fbd9d Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Sat, 11 Jul 2020 23:04:16 +0200 +Subject: [PATCH] ECMAddTests.cmake: Skip ecm_add_test early if Qt::Test is not + available + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + modules/ECMAddTests.cmake | 9 +++++++++ + tests/ECMAddTests/CMakeLists.txt | 4 ++++ + 2 files changed, 13 insertions(+) + +diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake +index 58c78d05..994ed1e4 100644 +--- a/modules/ECMAddTests.cmake ++++ b/modules/ECMAddTests.cmake +@@ -84,6 +84,10 @@ function(ecm_add_test) + message(FATAL_ERROR "ecm_add_test() called with multiple source files but without setting \"TEST_NAME\"") + endif() + ++ if(NOT TARGET Qt::Test) ++ return() ++ endif() ++ + set(_testname ${ARG_NAME_PREFIX}${_targetname}) + set(gui_args) + if(ARG_GUI) +@@ -127,6 +131,11 @@ function(ecm_add_tests) + endif() + set(test_names) + set(target_names) ++ ++ if(NOT TARGET Qt::Test) ++ return() ++ endif() ++ + foreach(_test_source ${ARG_UNPARSED_ARGUMENTS}) + ecm_add_test(${_test_source} + NAME_PREFIX ${ARG_NAME_PREFIX} +diff --git a/tests/ECMAddTests/CMakeLists.txt b/tests/ECMAddTests/CMakeLists.txt +index aa7e73a1..5fbc1cc7 100644 +--- a/tests/ECMAddTests/CMakeLists.txt ++++ b/tests/ECMAddTests/CMakeLists.txt +@@ -2,6 +2,10 @@ if (QT_MAJOR_VERSION EQUAL "6") + set(QT_VERSION_OPT "-DBUILD_WITH_QT6=ON") + else() + set(QT_VERSION_OPT "-DBUILD_WITH_QT6=OFF") ++ ++if(NOT TARGET Qt::Test) ++ message(STATUS "WARNING: skipping tests that require Qt::Test") ++ return() + endif() + + macro(add_check NAME) +-- +2.35.1 + |
