Skip to content

Commit

Permalink
Revert "Bundle and ensure the exportation of rosidl generated targets (
Browse files Browse the repository at this point in the history
…ros2#601)" (ros2#611)

This reverts commit 204d920.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored Aug 9, 2021
1 parent b3e3e90 commit 0498704
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
7 changes: 0 additions & 7 deletions rosidl_cmake/cmake/rosidl_generate_interfaces.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,6 @@ macro(rosidl_generate_interfaces target)
)

if(NOT _ARG_SKIP_INSTALL)
# Ensure exported targets are imported before first use in downstream packages.
# This hook registers the ament_export_targets() extension, which populates
# ${PROJECT_NAME}_CONFIG_EXTRAS upon ament_package() invocation. It is crucial
# that ament_export_targets() configuration extras are found and included before
# any other configuration extras that make use of imported targets.
_ament_cmake_export_targets_register_package_hook()
if(NOT _ARG_SKIP_GROUP_MEMBERSHIP_CHECK)
set(_group_name "rosidl_interface_packages")
if(NOT _AMENT_PACKAGE_NAME)
Expand Down Expand Up @@ -307,7 +301,6 @@ macro(rosidl_generate_interfaces target)
endif()

if(NOT _ARG_SKIP_INSTALL)
ament_export_targets(${rosidl_generate_interfaces_TARGET})
foreach(_idl_tuple ${_idl_tuples})
string(REGEX REPLACE ":([^:]*)$" ";\\1" _idl_list "${_idl_tuple}")
list(GET _idl_list 1 _idl_relpath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
)
endif()
ament_export_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix})
ament_export_targets(${rosidl_generate_interfaces_TARGET}${_target_suffix})
install(
TARGETS ${rosidl_generate_interfaces_TARGET}${_target_suffix}
EXPORT ${rosidl_generate_interfaces_TARGET}
EXPORT ${rosidl_generate_interfaces_TARGET}${_target_suffix}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ if(NOT rosidl_generate_interfaces_SKIP_INSTALL)

install(
TARGETS ${rosidl_generate_interfaces_TARGET}${_target_suffix}
EXPORT ${rosidl_generate_interfaces_TARGET}
EXPORT ${rosidl_generate_interfaces_TARGET}${_target_suffix}
)
ament_export_targets(${rosidl_generate_interfaces_TARGET}${_target_suffix})
endif()

if(BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
endif()
install(
TARGETS ${rosidl_generate_interfaces_TARGET}${_target_suffix}
EXPORT ${rosidl_generate_interfaces_TARGET}
EXPORT ${rosidl_generate_interfaces_TARGET}${_target_suffix}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
rosidl_export_typesupport_targets(${_target_suffix}
${rosidl_generate_interfaces_TARGET}${_target_suffix})
ament_export_targets(${rosidl_generate_interfaces_TARGET}${_target_suffix})
endif()

if(BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
COMPILE_OPTIONS -Wall -Wextra -Wpedantic
)
endif()
target_link_libraries(
${rosidl_generate_interfaces_TARGET}${_target_suffix}
${rosidl_generate_interfaces_TARGET}__rosidl_generator_cpp)
target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_cpp>"
)
ament_target_dependencies(${rosidl_generate_interfaces_TARGET}${_target_suffix}
"rosidl_runtime_c"
"rosidl_typesupport_interface"
Expand Down Expand Up @@ -134,13 +135,14 @@ if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
endif()
install(
TARGETS ${rosidl_generate_interfaces_TARGET}${_target_suffix}
EXPORT ${rosidl_generate_interfaces_TARGET}
EXPORT ${rosidl_generate_interfaces_TARGET}${_target_suffix}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
rosidl_export_typesupport_targets(${_target_suffix}
${rosidl_generate_interfaces_TARGET}${_target_suffix})
ament_export_targets(${rosidl_generate_interfaces_TARGET}${_target_suffix})
endif()

if(BUILD_TESTING AND rosidl_generate_interfaces_ADD_LINTER_TESTS)
Expand Down

0 comments on commit 0498704

Please sign in to comment.