-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
154 lines (133 loc) · 5.38 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
cmake_minimum_required(VERSION 3.5)
project(rclada VERSION 0.1.0)
# To debug dependency graph:
# set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_DEBUG_MODE 1)
find_package(rclada_common REQUIRED)
ada_begin_package()
# ROS2 imports
find_package(action_msgs REQUIRED) # for the thin binding
find_package(rcl REQUIRED)
find_package(rcl_action REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw REQUIRED)
find_package(std_msgs REQUIRED) # Dependency of our test messages
find_package(std_srvs REQUIRED) # Export standard services to clients
find_package(test_msgs REQUIRED) # To stress the message generator
find_package(unique_identifier_msgs REQUIRED) # Required by actions
# Ada imports
find_package(rosidl_generator_ada REQUIRED)
# Generations of test messages, ROS2 standard
rosidl_generate_interfaces(${PROJECT_NAME}
msg/Test.msg
srv/Test.srv
DEPENDENCIES std_msgs
)
# We need to import our own messages for use in this same package
ada_import_interfaces(
${PROJECT_NAME}
std_msgs # we also use some std msgs in selftests
std_srvs # (same)
test_msgs # just because, to test our generator
)
# C imports for the Ada side
ada_import_c_libraries(${rcutils_LIBRARIES})
ada_import_c_libraries(${rcl_LIBRARIES})
ada_import_c_libraries(${rcl_action_LIBRARIES})
ada_import_c_libraries(${rmw_LIBRARIES})
# Find header folders
ada_find_package_include_dir(_action_msgs_include ${action_msgs_DIR})
ada_find_package_include_dir(_rcl_include ${rcl_DIR})
ada_find_package_include_dir(_rcl_action_include ${rcl_action_DIR})
ada_find_package_include_dir(_rcutils_include ${rcutils_DIR})
ada_find_package_include_dir(_rmw_include ${rmw_DIR})
ada_find_package_include_dir(_unique_identifier_msgs_include ${unique_identifier_msgs_DIR})
# Compile the list of dirs with header files. When installed, its always the
# same /opt/ros/foxy/include
list(APPEND _includes
${_rcutils_include}
${_rcl_include}
${_rcl_action_include}
${_rmw_include}
${_rosidl_gen_c_include}
# ${_rosidl_typesupport_interface_include}
${_unique_identifier_msgs_include}
/usr/include
)
# Bulk addition of headers. See below _extra_headers for a more controlled
# inclusion of needed C headers. This was done out of laziness, but including
# headers in an on-demand fashions is less likely to introduce problems with
# the binding autogenerator. OTOH, if bulk worked, it would be future-proof.
file(GLOB
_headers
"${_rcl_include}/rcl/*.h")
# Problematic headers not to process...
list(FILTER _headers EXCLUDE REGEX ".*/rcutils/stdatomic_helper.*")
list(FILTER _headers EXCLUDE REGEX ".*/rcl/rmw_implementation_identifier_check.h")
# Extra headers that we need.
# We don't use the glob tactic as for rcl/*.h because that brings in too much
# standard stuff, some of it not compilable.
set(_extra_headers
# ACTION MSGS (required by rcl_action)
${_action_msgs_include}/action_msgs/msg/detail/goal_info__struct.h
${_action_msgs_include}/action_msgs/msg/detail/goal_status__struct.h
${_action_msgs_include}/action_msgs/msg/detail/goal_status_array__struct.h
${_action_msgs_include}/action_msgs/srv/detail/cancel_goal__struct.h
# ACTIONS
${_rcl_action_include}/rcl_action/action_client.h
${_rcl_action_include}/rcl_action/action_server.h
${_rcl_action_include}/rcl_action/goal_handle.h
${_rcl_action_include}/rcl_action/types.h
${_rcl_action_include}/rcl_action/wait.h
# RCL UTILS
${_rcutils_include}/rcutils/allocator.h
${_rcutils_include}/rcutils/error_handling.h
${_rcutils_include}/rcutils/logging.h
${_rcutils_include}/rcutils/time.h
${_rcutils_include}/rcutils/types/char_array.h
${_rcutils_include}/rcutils/types/rcutils_ret.h
${_rcutils_include}/rcutils/types/string_array.h
${_rcutils_include}/rcutils/types/string_map.h
${_rcutils_include}/rcutils/types/uint8_array.h
# RMW
${_rmw_include}/rmw/init.h
${_rmw_include}/rmw/init_options.h
${_rmw_include}/rmw/localhost.h
${_rmw_include}/rmw/message_sequence.h
${_rmw_include}/rmw/names_and_types.h
${_rmw_include}/rmw/ret_types.h
${_rmw_include}/rmw/security_options.h
${_rmw_include}/rmw/serialized_message.h
${_rmw_include}/rmw/topic_endpoint_info.h
${_rmw_include}/rmw/topic_endpoint_info_array.h
${_rmw_include}/rmw/types.h
${_rmw_include}/rmw/qos_profiles.h
# UNIQUE IDENTIFIERS (required by action_msgs)
${_unique_identifier_msgs_include}/unique_identifier_msgs/msg/detail/uuid__struct.h
)
message(STATUS "INCLUDES ${_includes}")
message(STATUS "HEADERS ${_headers} ${_extra_headers}")
ada_generate_binding(
ada_binding_rcl
gpr_rcl
rcl.gpr
"${_includes}"
${_headers}
${_extra_headers}
)
# Selftest executables. Some of these depend on the Test.msg/srv.
ada_add_executables(
gpr_selftest
gpr_selftest
bin
# binaries
rclada_double_node
rclada_selftest_dynamic
rclada_selftest_static
rclada_test_allocators
rclada_test_multicore
)
add_dependencies(
gpr_selftest
ada_binding_rcl # We need our own RCL binding
)
ada_end_package()