Bug #1424
rst-convertersConfig.cmake needs to expose library dependencies for all dependencies
Status: | Resolved | Start date: | 02/19/2013 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | J. Wienke | % Done: | 100% | |
Category: | Build System | Estimated time: | 1.00 hour | |
Target version: | Robotics Service Bus - rsb-0.9 |
Description
rst-convertersConfig.cmake needs to expose library dependencies for all dependencies (e.g. OpenCV) as it it now only done for RCI.
Related issues
Associated revisions
fixes #1424: reduce public link interface
- Remove external dependencies from converter headers (as they are note
required there anyways) to reduce the public link interface of the library. - In CMake, explicitly state the reduced link interface.
fixes #1424: reduce public link interface
- Remove external dependencies from converter headers (as they are note
required there anyways) to reduce the public link interface of the library. - In CMake, explicitly state the reduced link interface.
fixes #1424: reduce public link interface
- Remove external dependencies from converter headers (as they are note
required there anyways) to reduce the public link interface of the library. - In CMake, explicitly state the reduced link interface.
History
#1 Updated by J. Wienke about 11 years ago
Actually this is probably only necessary for include paths, as libraries are already exposed in the depends files:
SET(CMAKE_IMPORT_FILE_VERSION 1) # Create imported target rstconverters ADD_LIBRARY(rstconverters SHARED IMPORTED) # Import target "rstconverters" for configuration "debug" SET_PROPERTY(TARGET rstconverters APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) SET_TARGET_PROPERTIES(rstconverters PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG "rsb;rst;rstsandbox;opencv_gpu;opencv_contrib;opencv_legacy;opencv_objdetect;opencv_calib3d;opencv_features2d;opencv_video;opencv_highgui;opencv_ml;opencv_imgproc;opencv_flann;opencv_core" IMPORTED_LOCATION_DEBUG "/homes/jwienke/workspace/git/rst-converters/cpp/build-master/build/librstconverters.so.0.9" IMPORTED_SONAME_DEBUG "librstconverters.so.0.9" )
#2 Updated by Anonymous about 11 years ago
In a dependeing project this leads to
/usr/bin/ld: warning: libcv.so.2.1, needed by [...]/lib/librstconverters.so.0.9, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libml.so.2.1, needed by [...]/lib/librstconverters.so.0.9, not found (try using -rpath or -rpath-link) [...]
So it seems that library dirs for e.g. opencv libraries are not properly exposed.
#3 Updated by Anonymous about 11 years ago
Feedback by Alexandre Tuleu:
I have a file /usr/share/rst-converters0.9/rst-converters-depends-relWithDebInfo.cmake that contains linking flags to opencv
I have looked up upon /usr/include/rst-converters0.9 and there is no include to any OpenCV files.
So it seems that OpenCV is an implicit hidden dependency of rst-converters. User of rst-converters does not have to use any symbol of opencv.
But the depends file make this explicit, by exporting the linking flags (but it should be removable, as dependencies on rst-converters does not need any opencv symbols).
But the config file of rst-converters allow the build configuration to pass even if opencv header are not installed on the system,
To fix the sityuation, either :
- fix rst-converters-depends file to strip all opencv stuff (Recommended, less dependcencies. Do not forget to add OpenCV as binary deps of the debian packages)
OR- add find_package(OpenCV REQUIRED) in rst-convertersConfig.cmake
Johannes, what do you think?
#4 Updated by J. Wienke about 11 years ago
I don't really understand the feedback and what is happening here. We only build the opencv-converters if opencv is generated and the depends file is generated by cmake. So I suspect a cmake bug.
With respect to grepping for opencv through the header files: With the generic converter interface of RSB it is quite likely that such a dependency is not visible in the header, as the converters do not have any specific data types in their interfaces.
#5 Updated by J. Moringen almost 11 years ago
- Assignee set to J. Wienke
- Priority changed from Normal to High
#6 Updated by J. Wienke almost 11 years ago
I have no idea how to fix this.
#7 Updated by J. Wienke almost 11 years ago
I thought about this a bit more. Most of the issues can probably be resolved if the converters do not expose the dependencies at all and hence no dependencies need to be visible in the link interfaces. The attached patch should do this. I could not test it with RCI enabled. So I don't know whether the changes in these converters compile correctly.
#8 Updated by J. Wienke almost 11 years ago
- % Done changed from 0 to 30
#9 Updated by J. Wienke almost 11 years ago
- Status changed from New to Resolved
- % Done changed from 30 to 100
Applied in changeset rst-converters|commit:271837c326641d6d54597810b27f4b36aceaf650.