Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Simplify code coverage CMake toggle

Commit
51e281a6842ae4b38120d78154f049275a351894
Author
Martin Hořeňovský ·
Parents
24851dff9937

Files · Download .tar.gz

Changes

 CMakeLists.txt | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ff2f54e..e06c26d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -281,11 +281,6 @@ set(HEADERS
 SOURCE_GROUP("Tests" FILES ${TEST_SOURCES})
 SOURCE_GROUP("Surrogates" FILES ${SURROGATE_SOURCES})
 
-# configure the executable
-if (ENABLE_COVERAGE)
-    list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
-    find_package(codecov)
-endif()
 
 # Projects consuming Catch via ExternalProject_Add might want to use install step
 # without building all of our selftests.
@@ -305,6 +300,8 @@ if (NOT NO_SELFTEST)
     set_property(TARGET SelfTest PROPERTY CXX_EXTENSIONS OFF)
 
     if (ENABLE_COVERAGE)
+        list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
+        find_package(codecov)
         add_coverage(SelfTest)
         list(APPEND LCOV_REMOVE_PATTERNS "/usr/")
         coverage_evaluate()