-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (46 loc) · 1.74 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.13.5 FATAL_ERROR)
project(unit-test-example CXX)
# -- includes ------------------------------------------------------------------
include(FetchContent)
# -- opt-in to new behavior ----------------------------------------------------
# See https://cmake.org/cmake/help/latest/policy/CMP0135.html
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# -- options -------------------------------------------------------------------
option(BUILD_SHARED_LIBS "Build shared library targets" OFF)
set(SANITIZERS "" CACHE STRING "Selected sanitizers, e.g., 'address,undefined'")
set(CAF_TAG "94cec61" CACHE STRING "The tag of the CAF version to use")
set(CXX_VERSION "17" CACHE STRING "The C++ version to use")
# -- embed CAF -----------------------------------------------------------------
function(get_caf)
# Fetch CAF from the official repository.
FetchContent_Declare(
caf
GIT_REPOSITORY https://github.com/actor-framework/actor-framework.git
GIT_TAG ${CAF_TAG}
EXCLUDE_FROM_ALL
)
# Select the parts of CAF we need.
set(CAF_ENABLE_NET_MODULE ON)
set(CAF_ENABLE_EXAMPLES OFF)
set(CAF_ENABLE_IO_MODULE OFF)
set(CAF_ENABLE_TESTING OFF)
set(CAF_ENABLE_TOOLS OFF)
# Pass along build options.
set(CAF_CXX_VERSION ${CXX_VERSION})
set(CAF_SANITIZERS ${SANITIZERS})
# Build CAF as a sub-project.
FetchContent_MakeAvailable(caf)
endfunction()
get_caf()
# -- build the examples --------------------------------------------------------
enable_testing()
add_subdirectory(fixtures)
add_subdirectory(log)
add_subdirectory(multi-suites-explicit)
add_subdirectory(multi-suites-generated)
add_subdirectory(outlines)
add_subdirectory(scenarios)
add_subdirectory(sections)
add_subdirectory(simple)