-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup CMakeLists target dependencies #228
Cleanup CMakeLists target dependencies #228
Conversation
Codecov Report
@@ Coverage Diff @@
## master #228 +/- ##
=======================================
Coverage 47.35% 47.35%
=======================================
Files 143 143
Lines 13347 13347
=======================================
Hits 6321 6321
Misses 7026 7026 Continue to review full report at Codecov.
|
dab513c
to
f499e2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just looked through it once, commenting what I didn't immediately understand.
${urdfdom_LIBRARIES} | ||
${urdfdom_headers_LIBRARIES} | ||
${rclcpp_headers_LIBRARIES} | ||
${geometric_shapes_LIBRARIES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are none of these needed anymore?
the test does use, e.g., moveit_constraint_samplers
for all that I can see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moveit_constraint_samplers
is ${MOVEIT_LIB_NAME}
. All other targets are provided with $MOVEIT_LIB_NAME
so I didn't specify the same deps again for the test.
urdfdom | ||
urdfdom_headers | ||
octomap_msgs | ||
OCTOMAP | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added public target includes for octomap before so that other libs linking with moveit_planning_scene
automatically include the octomap headers. Does ament_target_dependencies
automagically add the correct target includes as public/interface/private? How would it differentiate between private and non-private includes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not PUBLIC in MoveIt 1, so I removed it. We can specify octomap PUBLIC with ament_target_dependencies though.
ament_target_dependencies(test_planning_scene | ||
ament_index_cpp | ||
geometric_shapes | ||
srdfdom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
urdf_parser
is included, but not listed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provided by ${MOVEIT_LIB_NAME}
${MOVEIT_LIB_NAME} | ||
${urdfdom_LIBRARIES} | ||
${urdfdom_headers_LIBRARIES}) | ||
target_link_libraries(test_multi_threaded moveit_test_utils ${MOVEIT_LIB_NAME}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robot_state
, robot_model
and collision_detection
are included, but not listed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
${MOVEIT_LIB_NAME} | ||
${geometric_shapes_LIBRARIES} | ||
resource_retriever::resource_retriever | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robot_state
, robot_model
, and robot_trajectory
are included but not listed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@v4hn thanks for reviewing this. My goal was to remove all the very generic (and often redundant) |
1f2bf1d
to
1525b39
Compare
Now this is somewhat a matter of build-system philosophy (if such a term exists 😎). The consistent approach to header includes and linking definitions is to include and link what you use, whether or not you also depend on it transitively. This is because (1) you can syntactically identify all places depending on a package and (2) if the transitive dependency at some point vanishes, the code might still work. I tend to use this approach in my projects, but I do see the benefits of leaving them out. I will leave it to someone else to accept this as I would not do it that way myself. |
I totally see your point. But then again, I only applied this "cleanup" to test executables that don't have any downstream dependencies. All other exported targets also define and export their dependencies explicitly (instead of using global includes and library lists as before). So for me it's just a question of linking/including transitive dependencies to tests which are provided by a target in the same CMakeLists file. It probably is really a matter of style/convention at some point, similar to moveit/moveit#2170. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity I ran catkin_lint on this PR and these are the only cmake errors:
moveit_planners_chomp: CMakeLists.txt(16): error: duplicate find_package(catkin)
moveit_ros_robot_interaction: CMakeLists.txt(54): error: missing test_depend on 'rosunit'
moveit_setup_assistant: CMakeLists.txt(166): error: missing test_depend on 'rosunit'
I'm not sure if these matter, but they might be worth fixing while you are refactoring some of the cmake files. I looked through these changes and they seem to make sense to me. I'll approve it as I don't have anything against these changes.
@tylerjw Thanks for reviewing and testing catkin_lint on this. The failing packages have not been ported yet and have therefore not been checked by |
Started looking into dependency issues with the Foxy branch and ended up cleaning up most of the dependencies.