diff options
-rw-r--r-- | CMakeLists.txt | 23 |
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() |