ros2 / demos

Apache License 2.0
493 stars 329 forks source link

Cleanup demo_nodes_cpp CMake and dependencies #638

Closed clalancette closed 1 year ago

clalancette commented 1 year ago

I was looking at demo_nodes_cpp, and I noticed a few different things:

  1. The includes in the various source files weren't always correct. We were missing some includes, and we had some other includes that weren't actually being used.
  2. The dependencies weren't correctly specified, in that we were missing a couple.
  3. We don't really need to use ament_target_dependencies in the CMakeLists.txt; we can instead use target_link_libraries.
  4. There was actually quite a bit of duplication in the various install targets. We could probably use a function to reduce duplication.

This PR fixes all of that, and removes about 10 lines of code in the process.

clalancette commented 1 year ago

CI: