-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
49 lines (42 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
cmake_minimum_required(VERSION 3.16)
project(otimapp CXX)
add_subdirectory(./otimapp)
add_subdirectory(./third_party/googletest)
add_executable(app app.cpp)
target_compile_features(app PUBLIC cxx_std_17)
target_link_libraries(app lib-otimapp)
add_executable(app_random_graph app_random_graph.cpp)
target_compile_features(app PUBLIC cxx_std_17)
target_link_libraries(app_random_graph lib-otimapp)
add_executable(exec exec.cpp)
target_compile_features(exec PUBLIC cxx_std_17)
target_link_libraries(exec lib-otimapp)
# format
add_custom_target(clang-format
COMMAND clang-format -i
../otimapp/include/*.hpp
../otimapp/src/*.cpp
../tests/*.cpp
../app.cpp
../app_random.cpp)
# test
set(TEST_MAIN_FUNC ./third_party/googletest/googletest/src/gtest_main.cc)
set(TEST_ALL_SRC ${TEST_MAIN_FUNC})
macro(add_test name target)
add_executable(${name} ${target} ${TEST_MAIN_FUNC})
target_link_libraries(${name} lib-otimapp gtest)
list(APPEND TEST_ALL_SRC ${target})
endmacro(add_test)
# basic
add_test(test_problem ./tests/test_problem.cpp)
add_test(test_agent ./tests/test_agent.cpp)
add_test(test_execution ./tests/test_execution.cpp)
add_test(test_fragment ./tests/test_fragment.cpp)
add_test(test_random_graph ./tests/test_random_graph.cpp)
# solver
add_test(test_pp ./tests/test_pp.cpp)
add_test(test_cp ./tests/test_dbs.cpp)
add_test(test_m_tolerant ./tests/test_m_tolerant.cpp)
#
add_executable(test ${TEST_ALL_SRC})
target_link_libraries(test lib-otimapp gtest)