-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (36 loc) · 1.24 KB
/
CMakeLists.txt
File metadata and controls
46 lines (36 loc) · 1.24 KB
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
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.20)
project(CCCBTemplate)
option(BUILD_UNIT_TESTS "Build unit tests (default OFF)" OFF)
option(CODE_COVERAGE "Enable coverage reporting (default OFF)" OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CMake/conan.cmake)
conan_cmake_run(REQUIRES
boost/1.77.0
BASIC_SETUP CMAKE_TARGETS NO_OUTPUT_DIRS
BUILD missing
OPTIONS
boost:shared=False
boost:without_test=False
boost:without_program_options=False
boost:without_filesystem=False
boost:without_system=False
boost:without_exception=False
boost:without_contract=False
)
conan_basic_setup(NO_OUTPUT_DIRS KEEP_RPATHS)
add_library(coverage_config INTERFACE)
if(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# Add required flags (GCC & LLVM/Clang)
target_compile_options(coverage_config INTERFACE
-O0 # no optimization
-g # generate debug info
--coverage # sets all required flags
)
target_link_options(coverage_config INTERFACE --coverage)
endif(CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_subdirectory(src)
if (BUILD_UNIT_TESTS)
enable_testing()
add_subdirectory(test)
endif()