diff --git a/CMLibCodeCoverage.cmake b/CMLibCodeCoverage.cmake index d472b80..528e1e9 100644 --- a/CMLibCodeCoverage.cmake +++ b/CMLibCodeCoverage.cmake @@ -1,7 +1,7 @@ function(add_code_coverage) list(GET ARGN 0 _target) - if(CMAKE_CXX_COMPILER_IS_GCC) + if(ENABLE_CODE_COVERAGE AND CMAKE_CXX_COMPILER_IS_GCC) find_program(LCOV_EXE NAMES lcov) find_program(GENHTML_EXE NAMES genhtml) target_compile_options(${_target} PUBLIC "--coverage")