-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
34 lines (23 loc) · 1.15 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.0)
project(cppmpi)
set(CMAKE_CXX_STANDARD 14)
option(ENABLE_COVERAGE "Set compiler flag for coverage analysis" OFF)
find_package(MPI REQUIRED)
add_subdirectory(external/catch)
include_directories(${CATCH_INCLUDE_DIR} include)
add_library(mpi_api INTERFACE)
target_include_directories(mpi_api INTERFACE ${CMAKE_SOURCE_DIR}/include)
target_include_directories(mpi_api INTERFACE SYSTEM ${MPI_CXX_INCLUDE_PATH})
include(CTest)
enable_testing()
add_subdirectory(tests)
if (ENABLE_COVERAGE)
add_custom_target(coverage
COMMAND lcov --capture --directory ${CMAKE_BINARY_DIR} --output-file coverage.info
# Remove the external libraries to get coverage for neon source only
COMMAND lcov --remove coverage.info '/usr/*'
'${CMAKE_BINARY_DIR}/catch*'
'${CMAKE_SOURCE_DIR}/tests*' -o coverage.info)
# COMMAND genhtml coverage.info --output-directory coverage_output
# COMMAND firefox coverage_output/index.html)
endif()