Skip to content

Install headers to include/${PROJECT_NAME} and Depend on rosidl_typesupport_* targets directly - #133

Merged
sloretz merged 6 commits into
masterfrom
test_msgs_depend_on_targets
Jan 25, 2022
Merged

sloretz merged 6 commits into
masterfrom
test_msgs_depend_on_targets

Conversation

@sloretz

@sloretz sloretz commented Dec 2, 2021 •

Copy link
Copy Markdown
Contributor

Part of ament/ament_cmake#365
Part of ros2/ros2#1150
Requires ros2/rosidl_python#149

This PR makes test_msgs depend on the generated rosidl_typesupport_c and rosidl_typesupport_cpp targets directly instead of depending on an internal ament_cmake variable. Then I made an INTERFACE target that exports the include directories instead of using ament_export_include_directories()

It also installs headers to include/${PROJECT_NAME} to avoid include directory search order issues when overriding packages. ros2/ros2#1150

@sloretz sloretz self-assigned this Dec 2, 2021
@sloretz

sloretz commented Dec 2, 2021

Copy link
Copy Markdown
Contributor Author

CI (build: --packages-up-to test_msgs test: --packages-select test_msgs)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz

sloretz commented Dec 6, 2021

Copy link
Copy Markdown
Contributor Author

Rerun of CI

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz

sloretz commented Dec 7, 2021

Copy link
Copy Markdown
Contributor Author

Oops, do not review. I think CI needs to be broader and I'm seeing an issue locally

@sloretz
sloretz marked this pull request as draft December 7, 2021 17:29
Comment thread test_msgs/CMakeLists.txt Outdated
include)
target_link_libraries(test_action_typesupport_c_builds
${_AMENT_EXPORT_LIBRARIES})
generate_test_msgs__rosidl_typesupport_c)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sloretz hmm, I'm a bit uncomfortable depending on targets that may or may not be available (as these are provided by rosidl-specific ament extensions). I know I'm opening a can of worms but if we have to do this, something's off.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think there isn't good support for using generated messages from the same package that generates them. It looks like a better option would be to use rosidl_get_typesupport_target() which was at least added for this purpose: ros2/rosidl#606

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using rosidl_get_typesupport_target() in 49addc7

@sloretz
sloretz marked this pull request as ready for review December 7, 2021 19:46
@sloretz

sloretz commented Dec 7, 2021

Copy link
Copy Markdown
Contributor Author

Ready for review again, this time building everything above test_msgs. I discovered the issue in my local workspace was due to a different package, and this PR is fine as is.

CI (build: --packages-above-and-dependencies test_msgs test: --packages-select test_msgs)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@sloretz sloretz changed the title Depend on rosidl_typesupport_* targets directly Install headers to include/${PROJECT_NAME} and Depend on rosidl_typesupport_* targets directly Jan 20, 2022
@sloretz

sloretz commented Jan 20, 2022

Copy link
Copy Markdown
Contributor Author

CI Re-run

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@sloretz
sloretz merged commit 3aecf01 into master Jan 25, 2022
@delete-merged-branch
delete-merged-branch Bot deleted the test_msgs_depend_on_targets branch January 25, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants