forked from BehaviorTree/BehaviorTree.ROS2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (68 loc) · 2.58 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
cmake_minimum_required(VERSION 3.16)
project(btcpp_ros2_samples)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(ament_cmake REQUIRED)
find_package(behaviortree_ros2 REQUIRED)
find_package(btcpp_ros2_interfaces REQUIRED)
find_package(std_msgs REQUIRED)
set(THIS_PACKAGE_DEPS
behaviortree_ros2
std_msgs
btcpp_ros2_interfaces )
######################################################
# Simple example showing how to use and customize the BtExecutionServer
add_executable(sample_bt_executor src/sample_bt_executor.cpp)
ament_target_dependencies(sample_bt_executor ${THIS_PACKAGE_DEPS})
######################################################
# Build an Action Client that calls the sleep action (STATIC version)
add_executable(sleep_client
src/sleep_action.cpp
src/sleep_client.cpp)
ament_target_dependencies(sleep_client ${THIS_PACKAGE_DEPS})
######################################################
# Build a client that call the sleep action (Plugin version)
add_library(sleep_plugin SHARED src/sleep_action.cpp)
target_compile_definitions(sleep_plugin PRIVATE BT_PLUGIN_EXPORT )
ament_target_dependencies(sleep_plugin ${THIS_PACKAGE_DEPS})
add_executable(sleep_client_dyn src/sleep_client.cpp)
target_compile_definitions(sleep_client_dyn PRIVATE USE_SLEEP_PLUGIN )
target_link_libraries(sleep_client_dyn sleep_plugin )
ament_target_dependencies(sleep_client_dyn ${THIS_PACKAGE_DEPS})
######################################################
# Build Server
add_executable(sleep_server src/sleep_server.cpp)
ament_target_dependencies(sleep_server ${THIS_PACKAGE_DEPS})
######################################################
# Build subscriber_test
add_executable(subscriber_test src/subscriber_test.cpp)
ament_target_dependencies(subscriber_test ${THIS_PACKAGE_DEPS})
######################################################
# INSTALL
install(TARGETS
sleep_client
sleep_client_dyn
sleep_server
sleep_plugin
subscriber_test
sample_bt_executor
DESTINATION lib/${PROJECT_NAME}
)
######################################################
# INSTALL plugins for other packages to load
install(TARGETS
sleep_plugin
LIBRARY DESTINATION share/${PROJECT_NAME}/bt_plugins
ARCHIVE DESTINATION share/${PROJECT_NAME}/bt_plugins
RUNTIME DESTINATION share/${PROJECT_NAME}/bt_plugins
)
######################################################
# INSTALL Behavior.xml's, ROS config and launch files
install(DIRECTORY
behavior_trees
config
launch
DESTINATION share/${PROJECT_NAME}/
)
ament_export_dependencies(behaviortree_ros2 btcpp_ros2_interfaces)
ament_package()