-
Notifications
You must be signed in to change notification settings - Fork 938
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
Handle multiple link libraries for FCL #2325
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2325 +/- ##
==========================================
- Coverage 57.93% 57.75% -0.17%
==========================================
Files 327 327
Lines 25633 25633
==========================================
- Hits 14848 14802 -46
- Misses 10785 10831 +46
Continue to review full report at Codecov.
|
find_path(LIBFCL_INCLUDE_DIRS fcl/config.h HINTS ${LIBFCL_PC_INCLUDE_DIR} ${LIBFCL_PC_INCLUDE_DIRS}) | ||
find_library(LIBFCL_LIBRARIES fcl HINTS ${LIBFCL_PC_LIBRARY_DIRS}) | ||
|
||
set(LIBFCL_INCLUDE_DIRS ${LIBFCL_PC_INCLUDE_DIRS}) |
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.
Newer versions of fcl (ie not the system version in noetic ... what a mess ...) also provide a cmake config. So maybe
find_package(fcl REQUIRED)
already does the trick?
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.
Yes, I tried this before. It works here, locally. But exporting the required fcl
libs to downstream packages didn't work:
catkin provides two mechanisms to do this:
- For catkin packages via
CATKIN_DEPENDS
and - for 3rd-party packages via
DEPENDS
incatkin_package()
.
The latter - required here - requires to declare LIBFCL_INCLUDE_DIRS
and LIBFCL_LIBRARIES
. But, I failed to assemble LIBFCL_LIBRARIES
because fcl's cmake config declares an imported library target. Manually accessing IMPORTED_LOCATION
and INTERFACE_LINK_LIBRARIES
of that target was a nightmare and I gave up.
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.
Hmm, who besides collision_detection_fcl
needs that dependency? But looking at the documentation of catkin_package
I see your problem
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.
Who besides
collision_detection_fcl
needs that dependency?
moveit_compare_collision_checking_speed_fcl_bullet
was failing to link.
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.
Then the clean and lean find_package
could be moved to these two directly? Normally the fcl dependency should be abstracted away right?
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.
Maybe. I'm not sure moveit_compare_collision_checking_speed_fcl_bullet
explicitly uses fcl functionality. If so, it should find_package(fcl)
itself, I agree.
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.
Given the fact that we need to handle FCL 0.5 for Melodic, we are stuck to pkgconfig for now.
Hence, I would like to get this basic fix merged as is.
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.
Thanks for working on this. Makes sense to me.
This is in preparation to use fcl 0.6.1 in Noetic. See ros/rosdistro#26527 for details.
Our cmake code to find absolute library paths of FCL libs was only handling a single lib (namely
libfcl
). However, future releases oflibfcl
declare several link libraries. To correctly link to those, we need to find absolute paths for all of them.