summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/libdnf/libdnf/0001-Add-WITH_TESTS-option.patch
blob: 384add5e12f880e82dc84fee828f52b80e2968e2 (plain)
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
From 7d60d62b5c5374156703ca7262fb2f85ec5db119 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex.kanavin@gmail.com>
Date: Tue, 6 Nov 2018 13:54:43 +0100
Subject: [PATCH] Add WITH_TESTS option

This makes a dependency on cppunit optional.

Upstream-Status: Pending
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>

---
 CMakeLists.txt               | 3 +++
 python/hawkey/CMakeLists.txt | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c6e1b2f..8599c540 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON)
 option(WITH_ZCHUNK "Build with zchunk support" ON)
 option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF)
 option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF)
+option(WITH_TESTS "Enables unit tests" ON)
 
 
 # build options - debugging
@@ -179,8 +180,10 @@ endif()
 
 
 # build tests
+IF (WITH_TESTS)
 enable_testing()
 add_subdirectory(tests)
+ENDIF()
 if(WITH_BINDINGS)
     add_subdirectory(python/hawkey)
 endif()
diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt
index d9645346..84d17204 100644
--- a/python/hawkey/CMakeLists.txt
+++ b/python/hawkey/CMakeLists.txt
@@ -50,4 +50,6 @@ target_link_libraries(_hawkeymodule ${PYTHON_LIBRARY})
 install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
 install(TARGETS _hawkeymodule LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
 
+IF (WITH_TESTS)
 add_subdirectory(tests)
+ENDIF()