Skip to content
Snippets Groups Projects
Commit 77902ad8 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Added missing coverage in CMake

parent 739328d6
No related branches found
No related tags found
1 merge request!3Added coverage
Pipeline #31160 failed
......@@ -14,7 +14,7 @@ build:ubuntu_cpp:
- export CMAKE_PREFIX_PATH=../install_cpp
- mkdir -p build_cpp
- cd build_cpp
- cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON ..
- cmake -DCMAKE_INSTALL_PREFIX:PATH=../install_cpp -DCMAKE_BUILD_TYPE=Debug -DWERROR=ON -DCOVERAGE=ON ..
- make -j4 all install
artifacts:
......
......@@ -21,6 +21,17 @@ include(PybindModuleCreation)
# Define options
option(PYBIND "python binding" ON)
option(WERROR "Warning as error" OFF)
option(TEST "Enable tests" ON)
option(COVERAGE "Enable coverage" OFF)
##############################################
# Import utils CMakeLists
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
include(PybindModuleCreation)
if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE)
Include(CodeCoverage)
endif()
##############################################
# Find system dependencies
......@@ -79,6 +90,10 @@ else()
/W4>)
endif()
if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE)
append_coverage_compiler_flags()
endif()
##############################################
# Installation instructions
......@@ -129,6 +144,7 @@ export(EXPORT ${project}-targets
##############################################
## Add test
enable_testing()
add_subdirectory(unit_tests)
if(TEST)
enable_testing()
add_subdirectory(unit_tests)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment