-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
46 lines (35 loc) · 1.05 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
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.23)
project(ruek VERSION 0.3.1 LANGUAGES CXX)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
option(RUEK_BUILD_BENCHMARKS
"Build benchmarks" OFF
)
include(CMakeDependentOption)
cmake_dependent_option(RUEK_BUILD_TESTING
"Build tests when this is the root project" ON
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)
cmake_dependent_option(RUEK_ENABLE_COVERAGE
"Enable code coverage when RUEK_BUILD_TESTING is enabled and this is the root project" ON
"RUEK_BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)
if (RUEK_ENABLE_COVERAGE)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR
"Code coverage is only available with clang. "
"Can't continue with RUEK_ENABLE_COVERAGE=ON."
)
endif()
endif()
include(cmake/dependencies.cmake)
if (RUEK_BUILD_TESTING)
enable_testing()
endif()
if (RUEK_BUILD_BENCHMARKS)
add_subdirectory(bench)
endif()
add_subdirectory(proto)
add_subdirectory(src)