-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
74 lines (65 loc) · 1.91 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
cmake_minimum_required(VERSION 3.16.3)
project(bt_ros_example)
find_package(ament_cmake REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(behaviortree_cpp_v3 REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_index_cpp
behaviortree_cpp_v3
std_msgs
rclcpp
rclcpp_components
)
include_directories(
include
${PCL_INCLUDE_DIRS}
)
add_library(test_bt SHARED
src/subscriber_input.cpp
src/subscriber_input_coro.cpp
)
target_include_directories(test_bt
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:include>)
ament_target_dependencies(test_bt ${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(test_bt)
add_library(ros_node SHARED src/ros_node.cpp)
target_include_directories(ros_node
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:include>)
ament_target_dependencies(ros_node ${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(ros_node
test_bt
)
add_executable(ros_node_main src/ros_node_main.cpp)
target_include_directories(ros_node_main
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:include>)
ament_target_dependencies(ros_node_main ${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(ros_node_main
ros_node
)
# Install libraries
install(
TARGETS
test_bt
ros_node
EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# Install executables
install(
TARGETS
ros_node_main
ARCHIVE DESTINATION lib/${PROJECT_NAME}
LIBRARY DESTINATION lib/${PROJECT_NAME}
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()