aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 19 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ca8dbe..4be6ca1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,16 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
set(PROJECT_VERSION "2.1.2")
set(PACKAGE ${CMAKE_PROJECT_NAME})
-option (enable_tests "Build the package's automatic tests." ON)
+# Options
+option(ENABLE_TESTS "Enable all tests and checks" OFF)
+option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
+
+if(ENABLE_COVERAGE)
+ set(ENABLE_TESTS ON)
+ set(CMAKE_BUILD_TYPE "Coverage")
+else()
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
##
## GNU standard installation directories
@@ -85,13 +94,15 @@ add_subdirectory(po)
# testing & coverage
-if (${enable_tests})
+if (ENABLE_TESTS)
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_COVERAGE)
+ find_package(CoverageReport)
+ ENABLE_COVERAGE_REPORT(
+ TARGETS ayatanaindicatorpowerservice ayatana-indicator-power-service
+ TESTS ${COVERAGE_TEST_TARGETS}
+ FILTER /usr/include ${CMAKE_BINARY_DIR}/*
+ )
+ endif ()
endif ()