summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-07-12 18:11:53 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-07-13 01:07:42 +0200
commitd94bc055c78c6c94bd16f71978787ee8876d1f4a (patch)
treea2ee6483eb8d1d47ca92ca1d2802c020bed243fe /kde-frameworks/extra-cmake-modules/files
parentsys-power/intel-undervolt: sync live ebuild (diff)
downloadgentoo-d94bc055c78c6c94bd16f71978787ee8876d1f4a.tar.gz
gentoo-d94bc055c78c6c94bd16f71978787ee8876d1f4a.tar.bz2
gentoo-d94bc055c78c6c94bd16f71978787ee8876d1f4a.zip
kde-frameworks/extra-cmake-modules: Skip ecm_add_test w/o Qt5::Test
Bug: https://bugs.gentoo.org/651978 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'kde-frameworks/extra-cmake-modules/files')
-rw-r--r--kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.72.0-skip-ecm_add_test-early.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.72.0-skip-ecm_add_test-early.patch b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.72.0-skip-ecm_add_test-early.patch
new file mode 100644
index 00000000000..72541d73e72
--- /dev/null
+++ b/kde-frameworks/extra-cmake-modules/files/extra-cmake-modules-5.72.0-skip-ecm_add_test-early.patch
@@ -0,0 +1,54 @@
+From ad3aec71ed7f8820e69fe55489368a19d0735ab5 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 Qt5::Test is not available
+
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ modules/ECMAddTests.cmake | 9 +++++++++
+ tests/ECMAddTests/CMakeLists.txt | 5 +++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake
+index 4bc7fb8..12825aa 100644
+--- a/modules/ECMAddTests.cmake
++++ b/modules/ECMAddTests.cmake
+@@ -81,6 +81,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 Qt5::Test)
++ return()
++ endif()
++
+ set(_testname ${ARG_NAME_PREFIX}${_targetname})
+ set(gui_args)
+ if(ARG_GUI)
+@@ -122,6 +126,11 @@ function(ecm_add_tests)
+ endif()
+ set(test_names)
+ set(target_names)
++
++ if(NOT TARGET Qt5::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 e77b33f..4e191fe 100644
+--- a/tests/ECMAddTests/CMakeLists.txt
++++ b/tests/ECMAddTests/CMakeLists.txt
+@@ -1,3 +1,8 @@
++if(NOT TARGET Qt5::Test)
++ message(STATUS "WARNING: skipping tests that require Qt5::Test")
++ return()
++endif()
++
+ macro(add_check NAME)
+ string(REPLACE "." "/" dir "${NAME}")
+ string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}")
+--
+2.27.0
+