1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From f3a754ddcbc8a086ca48920bd33e96082cef699c Mon Sep 17 00:00:00 2001
From: Pino Toscano <pino@kde.org>
Date: Mon, 2 Nov 2020 13:10:45 +0100
Subject: [PATCH] cmake: build test_ktechlab only if testing is enabled
The test_ktechlab static library basically builds almost all the
ktechlab sources, resulting in a "double build" in case testing is
enabled. Considering that is used only by test binaries built only
when testing is enabled, then limit its build accordingly.
---
src/CMakeLists.txt | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -379,19 +379,23 @@ install(TARGETS ktechlab ${INSTALL_TARGE
# for helping testing
-add_library(test_ktechlab STATIC ${ktechlab_SRCS})
+if(BUILD_TESTING)
-target_link_libraries(test_ktechlab
- KF5::TextEditor
- KF5::IconThemes
- KF5::Parts
- KF5::KHtml
- KF5::WidgetsAddons
- KF5::WindowSystem
-
- Qt5::Widgets
- Qt5::PrintSupport
-)
+ add_library(test_ktechlab STATIC ${ktechlab_SRCS})
+
+ target_link_libraries(test_ktechlab
+ KF5::TextEditor
+ KF5::IconThemes
+ KF5::Parts
+ KF5::KHtml
+ KF5::WidgetsAddons
+ KF5::WindowSystem
+
+ Qt5::Widgets
+ Qt5::PrintSupport
+ )
+
+endif()
########### install files ###############
|