This patch adds separate CMake macros to UseOROCOS-RTT.cmake to configure existing targets (component and plugin libraries) for Orocos independent of their creation and installation. Most work has been done by @snrkiwi.
orocos_configure_xxx(TARGET ...)
The configuration of a target for Orocos applies the following changes to the given target:
Append the Orocos target name (e.g. -gnulinux) to the library output name unless disabled by the macro flag NO_TARGET_SUFFIX (cmake property OUTPUT_NAME)
Set the library version if either COMPONENT_VERSION is set or VERSION is passed as a macro argument (cmake property VERSION)
Set the library output directory for component, plugin and typekit libraries generated in devel-space (without installation), such that they can be found in the respective paths expected by the RTT ComponentLoader and PluginLoader (cmake property LIBRARY_OUTPUT_DIRECTORY)
Define preprocessor symbol RTT_COMPONENT (for component libraries only)
Link to the Orocos RTT core libraries (OROCOS-RTT_LIBRARIES)
Add include directories, compile flags and linker flags exported by other Orocos packages that have been found by calling orocos_use_package() before. In catkin build mode (ORO_USE_CATKIN is true) the macro is implicitly called for all Orocos packages listed as build dependencies in package.xml. Unless OROCOS_NO_AUTO_LINKING is set, also link to all Orocos library targets.
Configure the rpath of installed libraries such that all library dependencies can be found at run-time, even if they are not located in a directory searched by default by the dynamic linker (cmake properties INSTALL_RPATH and CMAKE_INSTALL_RPATH_USE_LINK_PATH)
Export the library target for other packages within the same build-space (e.g. when using catkin_make), where the generated pkg-config files cannot be used yet.
All the steps of the respective orocos_configure_xxx() macro mentioned above.
New options for all macros
NO_TARGET_SUFFIX: do not append the Orocos target to the library and executable names (not required for single target installations)
QUIET: suppress the informational output of the macros
This patch adds separate CMake macros to UseOROCOS-RTT.cmake to configure existing targets (component and plugin libraries) for Orocos independent of their creation and installation. Most work has been done by @snrkiwi.
orocos_configure_xxx(TARGET ...)
The configuration of a target for Orocos applies the following changes to the given target:
-gnulinux
) to the library output name unless disabled by the macro flagNO_TARGET_SUFFIX
(cmake property OUTPUT_NAME)COMPONENT_VERSION
is set orVERSION
is passed as a macro argument (cmake property VERSION)ComponentLoader
andPluginLoader
(cmake property LIBRARY_OUTPUT_DIRECTORY)RTT_COMPONENT
(for component libraries only)OROCOS-RTT_LIBRARIES
)orocos_use_package()
before. In catkin build mode (ORO_USE_CATKIN
is true) the macro is implicitly called for all Orocos packages listed as build dependencies inpackage.xml
. UnlessOROCOS_NO_AUTO_LINKING
is set, also link to all Orocos library targets.OROCOS_DEFINED_<COMPS|LIBS|TYPES|PLUGINS>
needed for the generation of pkg-config (.pc) files inorocos_generate_package()
.orocos_xxx(TARGET SOURCES ...)
Everything else is only done by the full macros. The behavior of those macros should not have been changed by this patch.
CMAKE_INSTALL_PREFIX
catkin_make
), where the generated pkg-config files cannot be used yet.orocos_configure_xxx()
macro mentioned above.New options for all macros
NO_TARGET_SUFFIX
: do not append the Orocos target to the library and executable names (not required for single target installations)QUIET
: suppress the informational output of the macros