Instead of maintaining "xxx-disable-tests.patch" or patching cmake lists in place to remove all tests, why don't you simply inject if (NOT TARGET Qt5::Test) add_library(Qt5::Test UNKNOWN IMPORTED) endif() after "find_package(Qt5)" and rely on CMake + ecm_mark_as_test() on dropping the test from build?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=fa72e0874b0a88484fc507dca0b194e98640d76c commit fa72e0874b0a88484fc507dca0b194e98640d76c Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2020-07-11 21:56:59 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2020-07-12 22:53:05 +0000 */*: Switch from forceoptional-recursive back to forceoptional Now we rely on patched ECMAddTests.cmake to skip them. Closes: https://bugs.gentoo.org/651978 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> kde-apps/analitza/analitza-20.08.49.9999.ebuild | 2 +- kde-apps/analitza/analitza-9999.ebuild | 2 +- kde-apps/kdepim-addons/kdepim-addons-20.08.49.9999.ebuild | 2 +- kde-apps/kdepim-addons/kdepim-addons-9999.ebuild | 2 +- kde-apps/messagelib/messagelib-20.08.49.9999.ebuild | 2 +- kde-apps/messagelib/messagelib-9999.ebuild | 2 +- kde-plasma/milou/milou-5.19.49.9999.ebuild | 2 +- kde-plasma/milou/milou-9999.ebuild | 2 +- media-gfx/krita/krita-9999.ebuild | 2 +- media-video/subtitlecomposer/subtitlecomposer-9999.ebuild | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/kde.git/commit/?id=07cda4a3a1bd5fd356ea8a4961d6e12a2c870b98 commit 07cda4a3a1bd5fd356ea8a4961d6e12a2c870b98 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2020-07-12 18:48:47 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2020-07-12 22:53:27 +0000 media-gfx/krita: Update tests-optional patch Now we rely on patched ECMAddTests.cmake to skip them. The remaining patch is much smaller. Bug: https://bugs.gentoo.org/651978 Package-Manager: Portage-2.3.103, Repoman-2.3.23 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> .../krita/files/krita-4.3.1-tests-optional.patch | 80 ++++++++++++++++++++++ media-gfx/krita/krita-9999.ebuild | 2 + 2 files changed, 82 insertions(+) https://gitweb.gentoo.org/proj/kde.git/commit/?id=1b0294df9849933ffb3b0b22586677a71ebb0487 commit 1b0294df9849933ffb3b0b22586677a71ebb0487 Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2020-07-11 21:44:16 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2020-07-12 22:51:50 +0000 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> .../extra-cmake-modules-9999.ebuild | 1 + ...ke-modules-5.72.0-skip-ecm_add_test-early.patch | 54 ++++++++++++++++++++++ 2 files changed, 55 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d94bc055c78c6c94bd16f71978787ee8876d1f4a commit d94bc055c78c6c94bd16f71978787ee8876d1f4a Author: Andreas Sturmlechner <asturm@gentoo.org> AuthorDate: 2020-07-12 16:11:53 +0000 Commit: Andreas Sturmlechner <asturm@gentoo.org> CommitDate: 2020-07-12 23:07:42 +0000 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> .../extra-cmake-modules-5.72.0-r1.ebuild | 77 ++++++++++++++++++++++ ...ke-modules-5.72.0-skip-ecm_add_test-early.patch | 54 +++++++++++++++ 2 files changed, 131 insertions(+)