-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (26 loc) · 1.09 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
35
36
37
38
cmake_minimum_required (VERSION 2.8.12.2)
project (pfclib)
enable_testing ()
find_package(GTest REQUIRED)
option (BUILD_TESTS "Build tests" ON)
option (RUN_TESTS "Enable tests" ON)
option (RUN_VALGRIND "Enable valgrind of tests" ON)
option (ENABLE_GCOV "Enable gcov" OFF)
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Werror -Wno-pointer-sign -pedantic --std=gnu11 ")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Werror -std=c++11")
if (RUN_TESTS)
set (BUILD_TESTS ON)
if (RUN_VALGRIND)
set (VALGRIND_COMMAND valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --track-origins=yes --suppressions=./valgrind.suppress )
else (RUN_VALGRIND)
set (VALGRIND_COMMAND "")
endif (RUN_VALGRIND)
endif (RUN_TESTS)
if (ENABLE_GCOV)
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 -fprofile-arcs -ftest-coverage --coverage")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -fprofile-arcs -ftest-coverage --coverage")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage")
endif ()
add_compile_options (-g)
add_subdirectory (lib)
add_subdirectory (src)