@@ -16,6 +16,8 @@ find_package(rcpputils REQUIRED)
1616find_package (rcutils REQUIRED)
1717find_package (rmw REQUIRED)
1818find_package (rosgraph_msgs REQUIRED)
19+ find_package (rosidl_dynamic_typesupport REQUIRED)
20+ find_package (rosidl_runtime_c REQUIRED)
1921find_package (rosidl_runtime_cpp REQUIRED)
2022find_package (rosidl_typesupport_c REQUIRED)
2123find_package (rosidl_typesupport_cpp REQUIRED)
@@ -202,23 +204,28 @@ target_include_directories(${PROJECT_NAME} PUBLIC
202204 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
203205 "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /include>"
204206 "$<INSTALL_INTERFACE:include/${PROJECT_NAME} >" )
205- target_link_libraries (${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} )
206- # specific order: dependents before dependencies
207- ament_target_dependencies(${PROJECT_NAME}
208- "ament_index_cpp"
209- "libstatistics_collector"
210- "rcl"
211- "rcl_interfaces"
212- "rcl_logging_interface"
213- "rcl_yaml_param_parser"
214- "rcpputils"
215- "rcutils"
216- "builtin_interfaces"
217- "rosgraph_msgs"
218- "rosidl_typesupport_cpp"
219- "rosidl_runtime_cpp"
220- "statistics_msgs"
221- "tracetools"
207+ target_link_libraries (${PROJECT_NAME} PUBLIC
208+ ${builtin_interfaces_TARGETS}
209+ libstatistics_collector::libstatistics_collector
210+ rcl::rcl
211+ ${rcl_interfaces_TARGETS}
212+ rcl_yaml_param_parser::rcl_yaml_param_parser
213+ rcpputils::rcpputils
214+ rcutils::rcutils
215+ rmw::rmw
216+ ${rosgraph_msgs_TARGETS}
217+ rosidl_dynamic_typesupport::rosidl_dynamic_typesupport
218+ rosidl_runtime_c::rosidl_runtime_c
219+ rosidl_runtime_cpp::rosidl_runtime_cpp
220+ rosidl_typesupport_cpp::rosidl_typesupport_cpp
221+ ${statistics_msgs_TARGETS}
222+ tracetools::tracetools
223+ ${CMAKE_THREAD_LIBS_INIT}
224+ )
225+
226+ target_link_libraries (${PROJECT_NAME} PRIVATE
227+ ament_index_cpp::ament_index_cpp
228+ rcl_logging_interface::rcl_logging_interface
222229)
223230
224231# Causes the visibility macros to use dllexport rather than dllimport,
@@ -240,20 +247,23 @@ ament_export_libraries(${PROJECT_NAME})
240247# Export modern CMake targets
241248ament_export_targets(${PROJECT_NAME} )
242249
243- # specific order: dependents before dependencies
244- ament_export_dependencies(ament_index_cpp)
245- ament_export_dependencies(libstatistics_collector)
246- ament_export_dependencies(rcl)
247- ament_export_dependencies(rcpputils)
248- ament_export_dependencies(rcutils)
249- ament_export_dependencies(builtin_interfaces)
250- ament_export_dependencies(rosgraph_msgs)
251- ament_export_dependencies(rosidl_typesupport_cpp)
252- ament_export_dependencies(rosidl_typesupport_c)
253- ament_export_dependencies(rosidl_runtime_cpp)
254- ament_export_dependencies(rcl_yaml_param_parser)
255- ament_export_dependencies(statistics_msgs)
256- ament_export_dependencies(tracetools)
250+ ament_export_dependencies(
251+ builtin_interfaces
252+ libstatistics_collector
253+ rcl
254+ rcl_interfaces
255+ rcl_yaml_param_parser
256+ rcpputils
257+ rcutils
258+ rmw
259+ rosgraph_msgs
260+ rosidl_dynamic_typesupport
261+ rosidl_runtime_c
262+ rosidl_runtime_cpp
263+ rosidl_typesupport_cpp
264+ statistics_msgs
265+ tracetools
266+ )
257267
258268if (BUILD_TESTING)
259269 find_package (ament_lint_auto REQUIRED)
0 commit comments