diff --git a/CMakeLists.txt b/CMakeLists.txt index c54c035b1..138d64718 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,21 +24,6 @@ if(cmake_build_type_lower MATCHES "debug") endif() find_package(CoverageReport) -##################################################################### -# Enable code coverage calculation with gcov/gcovr/lcov -# Usage: -# * Switch build type to coverage (use ccmake or cmake-gui) -# * Invoke make, make test, make coverage (or ninja if you use that backend) -# * Find html report in subdir coveragereport -# * Find xml report feasible for jenkins in coverage.xml -##################################################################### -if(cmake_build_type_lower MATCHES coverage) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) - ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) -endif() find_package (ECM 1.7.0 QUIET NO_MODULE) if (ECM_FOUND) @@ -190,6 +175,22 @@ else() message(STATUS "Tests disabled") endif() +##################################################################### +# Enable code coverage calculation with gcov/gcovr/lcov +# Usage: +# * Switch build type to coverage (use ccmake or cmake-gui) +# * Invoke make, make test, make coverage (or ninja if you use that backend) +# * Find html report in subdir coveragereport +# * Find xml report feasible for jenkins in coverage.xml +##################################################################### +if(cmake_build_type_lower MATCHES coverage) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) + ENABLE_COVERAGE_REPORT(TARGETS ${SHELL_APP} FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) +endif() + add_subdirectory(plugins) #