-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
26 lines (21 loc) · 920 Bytes
/
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
# We might support earlier versions, too, but try to use a recent one.
cmake_minimum_required (VERSION 3.8)
project(feed-merger)
# option for code coverage
option(CODE_COVERAGE "Build with code coverage (GCC only)" OFF)
# If CODE_COVERAGE is on (e. g. via `cmake -DCODE_COVERAGE=ON`), then all
# binaries are built with code coverage. The option is off by default.
# Currently this only works with GCC.
if (CODE_COVERAGE)
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(FATAL_ERROR "Code coverage builds need GCC compiler!")
endif ()
# set coverage options for GCC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
endif ()
# Recurse into the subdirectory for source code.
add_subdirectory (src)
enable_testing()
# Recurse into the subdirectory for tests.
add_subdirectory (tests)