aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 15 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51e6c0a..f067b8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,9 +57,6 @@ add_custom_target (dist
COMMAND bzr export --root=${ARCHIVE_NAME} ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
-add_custom_target (clean-coverage
- COMMAND find ${CMAKE_BINARY_DIR} -name '*.gcda' | xargs rm -f)
-
add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2 --inline-suppr
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/tests)
@@ -67,28 +64,24 @@ add_custom_target (cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories (${CMAKE_CURRENT_BINARY_DIR}/src)
-# testing & coverage
-if (${ENABLE_TESTS})
-
- if (EXISTS /usr/src/googletest/src)
- set (GTEST_SOURCE_DIR /usr/src/googletest/src)
- else ()
- set (GTEST_SOURCE_DIR /usr/src/gtest/src)
- endif ()
- set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/..)
- set (GTEST_LIBS -lpthread)
- enable_testing ()
- if (${ENABLE_COVERAGE})
- include(GCov)
- endif ()
-endif ()
-
add_subdirectory (src)
add_subdirectory (data)
add_subdirectory (po)
-if (${ENABLE_TESTS})
- add_subdirectory (tests)
-endif ()
+
+if (ENABLE_TESTS)
+
+ include(CTest)
+ enable_testing()
+ add_subdirectory(tests)
+
+ if (ENABLE_COVERAGE)
+
+ find_package(CoverageReport)
+ ENABLE_COVERAGE_REPORT(TARGETS "libayatanaindicatorsessionservice" "ayatana-indicator-session-service" TESTS "test-service" "test-actions" "test-guest" "test-users" FILTER /usr/include ${CMAKE_BINARY_DIR}/*)
+
+ endif()
+
+endif()
# Display config info