-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
53 lines (38 loc) · 1.45 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
cmake_minimum_required(VERSION 3.13.0)
project(streamlet)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_executable(streamlet main.cpp)
target_include_directories(streamlet PRIVATE include)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE tests)
set(TEST_SOURCES
tests/main.cpp
tests/scheduler-test.cpp
tests/tree-test.cpp
tests/config-test.cpp
tests/runner-test.cpp
tests/service-test.cpp
tests/honest_node-test.cpp
tests/dishonest_node-test.cpp
tests/queue-test.cpp)
add_executable(tests ${TEST_SOURCES})
target_link_libraries(tests PUBLIC Catch)
target_include_directories(tests PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_include_directories(tests PRIVATE ${PROJECT_SOURCE_DIR}/tests)
include(FetchContent)
FetchContent_Declare(yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG yaml-cpp-0.6.3)
FetchContent_GetProperties(yaml-cpp)
if(NOT yaml-cpp_POPULATED)
message(STATUS "Fetching yaml-cpp...")
FetchContent_Populate(yaml-cpp)
add_subdirectory(${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR})
endif()
target_link_libraries(streamlet PUBLIC yaml-cpp)
target_link_libraries(tests PUBLIC yaml-cpp)
add_custom_command(TARGET tests PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res/ $<TARGET_FILE_DIR:tests>)
add_subdirectory(${PROJECT_SOURCE_DIR}/src)