forked from BehaviorTree/BehaviorTree.CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (50 loc) · 1.48 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
61
62
######################################################
# TESTS
set(BT_TESTS
src/action_test_node.cpp
src/condition_test_node.cpp
gtest_tree.cpp
gtest_sequence.cpp
gtest_parallel.cpp
gtest_fallback.cpp
gtest_factory.cpp
gtest_decorator.cpp
gtest_blackboard.cpp
gtest_preconditions.cpp
gtest_postconditions.cpp
gtest_ports.cpp
gtest_skipping.cpp
gtest_subtree.cpp
gtest_switch.cpp
gtest_wakeup.cpp
test_helper.hpp
script_parser_test.cpp
gtest_coroutines.cpp
)
set(TEST_DEPENDECIES
${BTCPP_LIBRARY}
foonathan::lexy
bt_sample_nodes)
if(ament_cmake_FOUND AND BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest_executable(${BTCPP_LIBRARY}_test ${BT_TESTS})
target_link_libraries(${BTCPP_LIBRARY}_test
${TEST_DEPENDECIES}
${ament_LIBRARIES})
elseif(catkin_FOUND AND CATKIN_ENABLE_TESTING)
catkin_add_gtest(${BTCPP_LIBRARY}_test ${BT_TESTS})
target_link_libraries(${BTCPP_LIBRARY}_test
${TEST_DEPENDECIES}
Threads::Threads
${catkin_LIBRARIES})
else()
find_package(GTest)
enable_testing()
add_executable(${BTCPP_LIBRARY}_test ${BT_TESTS})
target_link_libraries(${PROJECT_NAME}_test
${TEST_DEPENDECIES}
Threads::Threads
GTest::gtest)
endif()
target_include_directories(${BTCPP_LIBRARY}_test PRIVATE include ${PROJECT_SOURCE_DIR}/3rdparty)
target_compile_definitions(${BTCPP_LIBRARY}_test PRIVATE BT_TEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")