From fbf20bdf7ce5854ced0588e420b1c2a48df8ecf9 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 4 May 2021 13:43:11 +0200 Subject: CMakeLists.txt: Add coverage report support. Up to now, the -DENABLE_COVERAGE=ON option was a noopt cmdline parameter. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5be74c7..7430e86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,14 @@ if (ENABLE_TESTS) include(CTest) enable_testing() add_subdirectory(tests) + if (ENABLE_COVERAGE) + find_package(CoverageReport) + ENABLE_COVERAGE_REPORT( + TARGETS "ayatana-common" + TESTS "tst_utils" + FILTER /usr/include ${CMAKE_BINARY_DIR}/* + ) + endif() endif() # Display config info -- cgit v1.2.3