blob: ac9400c48dcec544d19d1240c8ae17fabb97b9f3 [file] [log] [blame]
Andrew Geissler4b740dc2020-05-05 08:54:39 -05001From 56fa2bbdbd29377a6ef0d0b7aadbac8b5ea8c95b 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
Andrew Geissler4b740dc2020-05-05 08:54:39 -050017index 881152a..965c992 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
Brad Bishopc342db32019-05-15 21:57:59 -040027 # load pkg-config first; it's required by other modules
Andrew Geissler4b740dc2020-05-05 08:54:39 -050028@@ -165,8 +166,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 Geissler4b740dc2020-05-05 08:54:39 -050040index d964534..84d1720 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()