aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-15 12:35:37 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-08-15 12:35:41 +0200
commit47c32024f8c476a80ea365a962b85213e043c6d1 (patch)
tree18e902b68c8b58a2f34e62a387bb8ed8db9bf35e /CMakeLists.txt
parent363e3a0bfab70884d75d5fa54e7eb96db5fb32a0 (diff)
downloadayatana-indicator-display-47c32024f8c476a80ea365a962b85213e043c6d1.tar.gz
ayatana-indicator-display-47c32024f8c476a80ea365a962b85213e043c6d1.tar.bz2
ayatana-indicator-display-47c32024f8c476a80ea365a962b85213e043c6d1.zip
CMakeLists.txt: Make running unit tests at build time optional, same for coverage reports.
Fixes AyatanaIndicators/ayatana-indicator-display#3.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbc6a20..bb4b531 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,9 @@ set(PACKAGE ${CMAKE_PROJECT_NAME})
set(SERVICE_LIB ${PACKAGE})
set(SERVICE_EXEC "${PACKAGE}-service")
+option(enable_tests "Build the package's automatic tests." ON)
+option(enable_coverage "Generate code coverage reports." OFF)
+
set(CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
set(CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
@@ -75,11 +78,15 @@ add_subdirectory(po)
## Testing & Coverage
##
-enable_testing()
-add_subdirectory(tests)
-find_package(CoverageReport)
-ENABLE_COVERAGE_REPORT(
- TARGETS ${SERVICE_LIB} ${SERVICE_EXEC}
- TESTS ${COVERAGE_TEST_TARGETS}
- FILTER /usr/include ${CMAKE_BINARY_DIR}/*
-)
+if(${enable_tests})
+ enable_testing()
+ add_subdirectory(tests)
+ if (${enable_coverage})
+ find_package(CoverageReport)
+ ENABLE_COVERAGE_REPORT(
+ TARGETS ${SERVICE_LIB} ${SERVICE_EXEC}
+ TESTS ${COVERAGE_TEST_TARGETS}
+ FILTER /usr/include ${CMAKE_BINARY_DIR}/*
+ )
+ endif()
+endif()