blob: 607995a39495339f6cd153ae11dd53d3e92be7b5 [file] [log] [blame]
Andrew Geissler475cb722020-07-10 16:00:51 -05001From 7d60d62b5c5374156703ca7262fb2f85ec5db119 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 6 Nov 2018 13:54:43 +0100
4Subject: [PATCH] Add WITH_TESTS option
5
6This makes a dependency on cppunit optional.
7
Andrew Geissler595f6302022-01-24 19:11:47 +00008Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1382]
Brad Bishop19323692019-04-05 15:28:33 -04009Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
10
11---
12 CMakeLists.txt | 3 +++
13 python/hawkey/CMakeLists.txt | 2 ++
14 2 files changed, 5 insertions(+)
15
16diff --git a/CMakeLists.txt b/CMakeLists.txt
Andrew Geissler475cb722020-07-10 16:00:51 -050017index 9c6e1b2f..8599c540 100644
Brad Bishop19323692019-04-05 15:28:33 -040018--- a/CMakeLists.txt
19+++ b/CMakeLists.txt
Andrew Geissler4b740dc2020-05-05 08:54:39 -050020@@ -33,6 +33,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON)
21 option(WITH_ZCHUNK "Build with zchunk support" ON)
Brad Bishopc342db32019-05-15 21:57:59 -040022 option(ENABLE_RHSM_SUPPORT "Build with Red Hat Subscription Manager support?" OFF)
23 option(ENABLE_SOLV_URPMREORDER "Build with support for URPM-like solution reordering?" OFF)
24+option(WITH_TESTS "Enables unit tests" ON)
Brad Bishop19323692019-04-05 15:28:33 -040025
Brad Bishop19323692019-04-05 15:28:33 -040026
Andrew Geissler475cb722020-07-10 16:00:51 -050027 # build options - debugging
28@@ -179,8 +180,10 @@ endif()
Brad Bishopc342db32019-05-15 21:57:59 -040029
30
31 # build tests
Brad Bishop19323692019-04-05 15:28:33 -040032+IF (WITH_TESTS)
Brad Bishopc342db32019-05-15 21:57:59 -040033 enable_testing()
34 add_subdirectory(tests)
Brad Bishop19323692019-04-05 15:28:33 -040035+ENDIF()
Brad Bishopc342db32019-05-15 21:57:59 -040036 if(WITH_BINDINGS)
37 add_subdirectory(python/hawkey)
38 endif()
Brad Bishop19323692019-04-05 15:28:33 -040039diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt
Andrew Geissler475cb722020-07-10 16:00:51 -050040index d9645346..84d17204 100644
Brad Bishop19323692019-04-05 15:28:33 -040041--- a/python/hawkey/CMakeLists.txt
42+++ b/python/hawkey/CMakeLists.txt
Brad Bishopc342db32019-05-15 21:57:59 -040043@@ -50,4 +50,6 @@ target_link_libraries(_hawkeymodule ${PYTHON_LIBRARY})
44 install(FILES __init__.py DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
45 install(TARGETS _hawkeymodule LIBRARY DESTINATION ${PYTHON_INSTALL_DIR}/hawkey)
Brad Bishop19323692019-04-05 15:28:33 -040046
47+IF (WITH_TESTS)
Brad Bishopc342db32019-05-15 21:57:59 -040048 add_subdirectory(tests)
Brad Bishop19323692019-04-05 15:28:33 -040049+ENDIF()