Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 1 | From 7d60d62b5c5374156703ca7262fb2f85ec5db119 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Tue, 6 Nov 2018 13:54:43 +0100 |
| 4 | Subject: [PATCH] Add WITH_TESTS option |
| 5 | |
| 6 | This makes a dependency on cppunit optional. |
| 7 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 8 | Upstream-Status: Submitted [https://github.com/rpm-software-management/libdnf/pull/1382] |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | Signed-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 | |
| 16 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 17 | index 9c6e1b2f..8599c540 100644 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 18 | --- a/CMakeLists.txt |
| 19 | +++ b/CMakeLists.txt |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 20 | @@ -33,6 +33,7 @@ option(WITH_MAN "Enables hawkey man page generation" ON) |
| 21 | option(WITH_ZCHUNK "Build with zchunk support" ON) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 27 | # build options - debugging |
| 28 | @@ -179,8 +180,10 @@ endif() |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 29 | |
| 30 | |
| 31 | # build tests |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 32 | +IF (WITH_TESTS) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 33 | enable_testing() |
| 34 | add_subdirectory(tests) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 35 | +ENDIF() |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 36 | if(WITH_BINDINGS) |
| 37 | add_subdirectory(python/hawkey) |
| 38 | endif() |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 39 | diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 40 | index d9645346..84d17204 100644 |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 41 | --- a/python/hawkey/CMakeLists.txt |
| 42 | +++ b/python/hawkey/CMakeLists.txt |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 43 | @@ -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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | |
| 47 | +IF (WITH_TESTS) |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 48 | add_subdirectory(tests) |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 49 | +ENDIF() |