Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 1 | From 56fa2bbdbd29377a6ef0d0b7aadbac8b5ea8c95b 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 | |
| 8 | Upstream-Status: Pending |
| 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 | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 17 | index 881152a..965c992 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 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 27 | # load pkg-config first; it's required by other modules |
Andrew Geissler | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 28 | @@ -165,8 +166,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 | 4b740dc | 2020-05-05 08:54:39 -0500 | [diff] [blame] | 40 | index d964534..84d1720 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() |