-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathCMakeLists.txt
38 lines (32 loc) · 969 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
27
28
29
30
31
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.1)
project(lorina LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Options
option(LORINA_EXAMPLES "Build examples" ON)
option(LORINA_TEST "Build tests" OFF)
option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" OFF)
if (UNIX)
# show quite some warnings (but remove some intentionally)
include(CheckCXXCompilerFlag)
add_compile_options(-Wall -Wextra -pedantic)
foreach (WARNING unknown-pragmas)
check_cxx_compiler_flag("-Wno-${WARNING}" HAS_WNO_${WARNING})
if (HAS_WNO_${WARNING})
add_compile_options(-Wno-${WARNING})
endif()
endforeach()
if (ENABLE_COVERAGE)
add_compile_options(-O0 -g --coverage -fprofile-arcs -ftest-coverage)
endif()
elseif (WIN32)
add_compile_definitions(NOMINMAX=1)
endif()
add_subdirectory(lib)
add_subdirectory(include)
if(LORINA_EXAMPLES)
add_subdirectory(examples)
endif()
if(LORINA_TEST)
add_subdirectory(test)
endif()