diff --git a/CMakeLists.txt b/CMakeLists.txt index 1155c64b..2e51ecf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,17 @@ option(RP3D_PROFILING_ENABLED "Select this if you want to compile for performana option(RP3D_CODE_COVERAGE_ENABLED "Select this if you need to build for code coverage calculation" OFF) option(RP3D_DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating values" OFF) +# Code Coverage +if(RP3D_CODE_COVERAGE_ENABLED) + INCLUDE(CodeCoverage) + SETUP_TARGET_FOR_COVERAGE_LCOV( + NAME coverage + EXECUTABLE "test/tests" + DEPENDENCIES Test) + APPEND_COVERAGE_COMPILER_FLAGS() + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") +endif() + # Headers files set (REACTPHYSICS3D_HEADERS "include/reactphysics3d/configuration.h" @@ -318,13 +329,3 @@ install(FILES DESTINATION lib/cmake/ReactPhysics3D ) -# Code Coverage -if(RP3D_CODE_COVERAGE_ENABLED) - INCLUDE(CodeCoverage) - SETUP_TARGET_FOR_COVERAGE_LCOV( - NAME coverage - EXECUTABLE "test/tests" - DEPENDENCIES Test) - APPEND_COVERAGE_COMPILER_FLAGS() - # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") -endif()