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
Catkin does not respect non-standard link directories for exported dependencies #535
Comments
We had this discussion internally a while back. We recommend using absolute paths and only the This is what I would recommend when a library you need to pass along provides names and dirs rather than paths, e.g. Another option would be to make an "extras" file for your package which sets the appropriate variables you are talking about and instruct users of your package to call the appropriate We talked about having catkin automatically transform these libraries, but we decided that there were too many variables involved in how you might want to go about doing that, so for the time being we do not plan to do that. Personally, I think having the first person to export a dependency like this use |
A little more about the ordering issue... Consider you have a system package, like |
Also, the extras files are definitively the solution for more exotic variables like |
Okay, I understand. Then we probably will only use absolute paths in |
I've also encountered this situation, and the proposed solution works for me just fine. I was wondering if an automated solution to the problem would be possible: Catkin could query the |
For the record, see the answer I posted to this question where a solution that is compatible with both multi-CMake project ( |
The new hydro-devel branch of rtt_ros_integration uses
to declare a dependency to Orocos RTT and OCL, which are not catkin packages. Due to a previous call to
find_package(OROCOS-RTT...)
the variablesrtt_FOUND
,rtt_INCLUDE_DIRS
,rtt_LIBRARY_DIRS
,rtt_LIBRARIES
,rtt_CFLAGS_OTHER
andrtt_LDFLAGS_OTHER
are defined at that time.Unfortunately the export mechanism of catkin currently does not work for this use case unless the
rtt_LIBRARIES
variable contains absolute paths, as these libraries are not within a CMAKE_PREFIX_PATH/lib folder and catkin does not look at thertt_LIBRARY_DIRS
variable, which would contain the correct paths to the RTT libraries. Ifrtt_LIBRARIES
contains only the names of the libraries, catkin produces linker error messages like this in every package that depends on the exporting package (rtt_roscomm) in this case:I guess this problem does not only affect this special use case with Orocos RTT, but also all other dependencies that are find_package()-able but have libraries in non-standard link directories. Catkin also does not export the CFLAGS_OTHER and LDFLAGS_OTHER variables, if set.
Is it possible to fix this in catkin itself or is this just a use case that is not supported? One option would probably be to resolve
${depend_name}_LIBRARIES
to absolute paths in catkin_pacakge.cmake:159 by callingfind_library(... PATHS ${${depend_name}_LIBRARY_DIRS})
?The text was updated successfully, but these errors were encountered: