-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (28 loc) · 1.06 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
cmake_minimum_required(VERSION 3.5)
project(graph_executor VERSION 0.0.1 LANGUAGES CXX)
include(ExternalProject)
find_package(Git REQUIRED)
ExternalProject_Add(
doctest
PREFIX ${CMAKE_BINARY_DIR}/doctest
GIT_REPOSITORY https://github.com/doctest/doctest.git
TIMEOUT 10
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)
# Expose required variable (DOCTEST_INCLUDE_DIR) to parent scope
ExternalProject_Get_Property(doctest source_dir)
set(DOCTEST_INCLUDE_DIR ${source_dir}/doctest CACHE INTERNAL "Path to include folder for doctest")
include_directories(${DOCTEST_INCLUDE_DIR})
set (CMAKE_CXX_STANDARD 17)
add_library(context STATIC context.cpp)
add_library(node STATIC node.cpp)
add_library(graph STATIC graph.cpp)
# Make test executable
add_executable(graph_test graph_test.cpp doctest)
set_target_properties(graph_test PROPERTIES ENABLE_EXPORTS 1)
target_include_directories(graph_test PRIVATE ${DOCTEST_INCLUDE_DIR})
target_link_libraries(graph_test PRIVATE context node graph)