blob: 3c87d4d8b33a9a601ca473030e35b5b8f245b87b [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001From e5a50db749b2b02e9e0cff9f7b639020e8ac76da 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
8Upstream-Status: Pending
9Signed-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
Brad Bishopc342db32019-05-15 21:57:59 -040017index ce88b9e3..7a99320a 100644
Brad Bishop19323692019-04-05 15:28:33 -040018--- a/CMakeLists.txt
19+++ b/CMakeLists.txt
Brad Bishopc342db32019-05-15 21:57:59 -040020@@ -32,6 +32,7 @@ option(WITH_HTML "Enables hawkey HTML generation" ON)
21 option(WITH_MAN "Enables hawkey man page generation" ON)
22 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
Brad Bishopc342db32019-05-15 21:57:59 -040027 # load pkg-config first; it's required by other modules
28@@ -158,8 +159,10 @@ endif()
29
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
Brad Bishopc342db32019-05-15 21:57:59 -040040index 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()