use rmw implementation
This commit is contained in:
parent
9603db7b7d
commit
fee3118bdd
4 changed files with 39 additions and 54 deletions
|
@ -7,7 +7,6 @@ find_package(rcl REQUIRED)
|
||||||
find_package(rcl_interfaces REQUIRED)
|
find_package(rcl_interfaces REQUIRED)
|
||||||
find_package(rmw REQUIRED)
|
find_package(rmw REQUIRED)
|
||||||
find_package(rmw_implementation REQUIRED)
|
find_package(rmw_implementation REQUIRED)
|
||||||
find_package(rmw_implementation_cmake REQUIRED)
|
|
||||||
find_package(rosidl_generator_cpp REQUIRED)
|
find_package(rosidl_generator_cpp REQUIRED)
|
||||||
find_package(rosidl_typesupport_c REQUIRED)
|
find_package(rosidl_typesupport_c REQUIRED)
|
||||||
find_package(rosidl_typesupport_cpp REQUIRED)
|
find_package(rosidl_typesupport_cpp REQUIRED)
|
||||||
|
@ -54,31 +53,24 @@ set(${PROJECT_NAME}_SRCS
|
||||||
src/rclcpp/utilities.cpp
|
src/rclcpp/utilities.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
macro(target)
|
add_library(${PROJECT_NAME} SHARED
|
||||||
if(NOT target_suffix STREQUAL "")
|
|
||||||
get_rcl_information("${rmw_implementation}" "rcl${target_suffix}")
|
|
||||||
endif()
|
|
||||||
add_library(${PROJECT_NAME}${target_suffix} SHARED
|
|
||||||
${${PROJECT_NAME}_SRCS})
|
${${PROJECT_NAME}_SRCS})
|
||||||
ament_target_dependencies(${PROJECT_NAME}${target_suffix}
|
ament_target_dependencies(${PROJECT_NAME}
|
||||||
"rcl${target_suffix}"
|
"rcl"
|
||||||
"rosidl_generator_cpp"
|
"rosidl_generator_cpp"
|
||||||
"rosidl_typesupport_cpp")
|
"rosidl_typesupport_cpp")
|
||||||
|
|
||||||
# Causes the visibility macros to use dllexport rather than dllimport,
|
# Causes the visibility macros to use dllexport rather than dllimport,
|
||||||
# which is appropriate when building the dll but not consuming it.
|
# which is appropriate when building the dll but not consuming it.
|
||||||
target_compile_definitions(${PROJECT_NAME}${target_suffix}
|
target_compile_definitions(${PROJECT_NAME}
|
||||||
PRIVATE "RCLCPP_BUILDING_LIBRARY")
|
PRIVATE "RCLCPP_BUILDING_LIBRARY")
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS ${PROJECT_NAME}${target_suffix}
|
TARGETS ${PROJECT_NAME}
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
)
|
)
|
||||||
endmacro()
|
|
||||||
|
|
||||||
call_for_each_rmw_implementation(target GENERATE_DEFAULT)
|
|
||||||
|
|
||||||
ament_export_dependencies(ament_cmake)
|
ament_export_dependencies(ament_cmake)
|
||||||
ament_export_dependencies(rcl)
|
ament_export_dependencies(rcl)
|
||||||
|
@ -94,6 +86,8 @@ if(BUILD_TESTING)
|
||||||
find_package(ament_lint_auto REQUIRED)
|
find_package(ament_lint_auto REQUIRED)
|
||||||
ament_lint_auto_find_test_dependencies()
|
ament_lint_auto_find_test_dependencies()
|
||||||
|
|
||||||
|
find_package(rmw_implementation_cmake REQUIRED)
|
||||||
|
|
||||||
ament_add_gtest(test_function_traits test/test_function_traits.cpp)
|
ament_add_gtest(test_function_traits test/test_function_traits.cpp)
|
||||||
if(TARGET test_function_traits)
|
if(TARGET test_function_traits)
|
||||||
target_include_directories(test_function_traits PUBLIC
|
target_include_directories(test_function_traits PUBLIC
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<build_export_depend>rmw</build_export_depend>
|
<build_export_depend>rmw</build_export_depend>
|
||||||
|
|
||||||
<build_depend>rcl_interfaces</build_depend>
|
<build_depend>rcl_interfaces</build_depend>
|
||||||
<build_depend>rmw_implementation_cmake</build_depend>
|
|
||||||
<build_depend>rosidl_generator_cpp</build_depend>
|
<build_depend>rosidl_generator_cpp</build_depend>
|
||||||
<build_depend>rosidl_typesupport_c</build_depend>
|
<build_depend>rosidl_typesupport_c</build_depend>
|
||||||
<build_depend>rosidl_typesupport_cpp</build_depend>
|
<build_depend>rosidl_typesupport_cpp</build_depend>
|
||||||
|
@ -30,6 +29,7 @@
|
||||||
<test_depend>ament_lint_auto</test_depend>
|
<test_depend>ament_lint_auto</test_depend>
|
||||||
<test_depend>ament_lint_common</test_depend>
|
<test_depend>ament_lint_common</test_depend>
|
||||||
<test_depend>rmw</test_depend>
|
<test_depend>rmw</test_depend>
|
||||||
|
<test_depend>rmw_implementation_cmake</test_depend>
|
||||||
|
|
||||||
<export>
|
<export>
|
||||||
<build_type>ament_cmake</build_type>
|
<build_type>ament_cmake</build_type>
|
||||||
|
|
|
@ -10,41 +10,33 @@ endif()
|
||||||
find_package(ament_cmake REQUIRED)
|
find_package(ament_cmake REQUIRED)
|
||||||
find_package(rclcpp REQUIRED)
|
find_package(rclcpp REQUIRED)
|
||||||
find_package(rcl_lifecycle REQUIRED)
|
find_package(rcl_lifecycle REQUIRED)
|
||||||
find_package(rmw_implementation_cmake REQUIRED)
|
|
||||||
find_package(std_msgs REQUIRED)
|
find_package(std_msgs REQUIRED)
|
||||||
find_package(lifecycle_msgs REQUIRED)
|
find_package(lifecycle_msgs REQUIRED)
|
||||||
|
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
|
|
||||||
macro(targets)
|
### CPP High level library
|
||||||
get_rclcpp_information("${rmw_implementation}" "rclcpp${target_suffix}")
|
add_library(rclcpp_lifecycle
|
||||||
get_rcl_lifecycle_information("${rmw_implementation}" "rcl_lifecycle${target_suffix}")
|
|
||||||
|
|
||||||
### CPP High level library
|
|
||||||
add_library(rclcpp_lifecycle${target_suffix}
|
|
||||||
SHARED
|
SHARED
|
||||||
src/lifecycle_node.cpp
|
src/lifecycle_node.cpp
|
||||||
src/node_interfaces/lifecycle_node_interface.cpp
|
src/node_interfaces/lifecycle_node_interface.cpp
|
||||||
src/state.cpp
|
src/state.cpp
|
||||||
src/transition.cpp
|
src/transition.cpp
|
||||||
)
|
)
|
||||||
ament_target_dependencies(rclcpp_lifecycle${target_suffix}
|
ament_target_dependencies(rclcpp_lifecycle
|
||||||
"lifecycle_msgs"
|
"lifecycle_msgs"
|
||||||
"rcl_lifecycle${target_suffix}"
|
"rcl_lifecycle"
|
||||||
"rclcpp${target_suffix}")
|
"rclcpp")
|
||||||
|
|
||||||
# Causes the visibility macros to use dllexport rather than dllimport,
|
# Causes the visibility macros to use dllexport rather than dllimport,
|
||||||
# which is appropriate when building the dll but not consuming it.
|
# which is appropriate when building the dll but not consuming it.
|
||||||
target_compile_definitions(rclcpp_lifecycle${target_suffix} PRIVATE "RCLCPP_LIFECYCLE_BUILDING_DLL")
|
target_compile_definitions(rclcpp_lifecycle PRIVATE "RCLCPP_LIFECYCLE_BUILDING_DLL")
|
||||||
|
|
||||||
install(TARGETS
|
install(TARGETS
|
||||||
rclcpp_lifecycle${target_suffix}
|
rclcpp_lifecycle
|
||||||
ARCHIVE DESTINATION lib
|
ARCHIVE DESTINATION lib
|
||||||
LIBRARY DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
RUNTIME DESTINATION bin)
|
RUNTIME DESTINATION bin)
|
||||||
endmacro()
|
|
||||||
|
|
||||||
call_for_each_rmw_implementation(targets GENERATE_DEFAULT)
|
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
find_package(ament_lint_auto REQUIRED)
|
find_package(ament_lint_auto REQUIRED)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
<build_depend>rclcpp</build_depend>
|
<build_depend>rclcpp</build_depend>
|
||||||
<build_depend>rcl_lifecycle</build_depend>
|
<build_depend>rcl_lifecycle</build_depend>
|
||||||
<build_depend>rmw_implementation</build_depend>
|
<build_depend>rmw_implementation</build_depend>
|
||||||
<build_depend>rmw_implementation_cmake</build_depend>
|
|
||||||
<build_depend>rosidl_default_generators</build_depend>
|
<build_depend>rosidl_default_generators</build_depend>
|
||||||
<build_depend>std_msgs</build_depend>
|
<build_depend>std_msgs</build_depend>
|
||||||
<build_depend>lifecycle_msgs</build_depend>
|
<build_depend>lifecycle_msgs</build_depend>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue