Skip to content
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

useorocos: add separate configuration macros independent of installation #306

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

meyerj
Copy link
Member

@meyerj meyerj commented Oct 22, 2019

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)
  • Add cmake dependencies to other exported targets (other than libraries) that need to be generated before, e.g. for code generation (see also cmake: remove ambiguity between exported targets and library names #244).
  • Append the target to OROCOS_DEFINED_<COMPS|LIBS|TYPES|PLUGINS> needed for the generation of pkg-config (.pc) files in orocos_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.

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

Stephen Roderick and others added 8 commits October 22, 2019 17:38
…in UseOROCOS-RTT

Suspect that this is a left-over copy/paste relic from the original work,
which used orocos_executable() as a beginning (which does use this variable).
Ensure the the library-related "orocos_xxx()" macros all follow
the same structure and ordering.

There should be not net change in semantics from this.
…table

Using orocos_executable() results in an executable that *is* suffixed
with the OROCOS target, but using orocos_configure_executable() results
in an executable that is *not* suffixed with the OROCOS target.

To reduce confusion standardize so that calling either function results
in an executable that *is* suffixed with the OROCOS target.
Add orocos_configure_xxx() macros for each of component libraries,
utility libraries, typekits, and plugins. This moves the
responsibility for the ADD_LIBRARY() and INSTALL() calls to the
application, instead of OROCOS.
…-RTT

Add a "NO_TARGET_SUFFIX" option to the orocos_xxx() and orocos_configure_xxx()
marcos - e.g. orocos_library(), orocos_configure_library() - that does *not*
add the OROCOS target as a suffix to the binary (e.g.  with NO_TARGET_SUFFIX
set "libxxx-gnulinux.so" becomes "libxxx.so" instead).

Applies to all binaries
- component library
- utility library
- executable
- typekit
- plugin
...to avoid duplicated CMake code.

Other small changes:
- Add option QUIET to most macros to suppress the informational message
  output, required to reduce verbosity for internal calls.
- Rename internal argument prefix ADD_COMPONENT to ORO_COMPONENT for
  consistency.
- Remove comment "For ros builds, the version number is ignored.". Not
  sure why this should be the case. The target property is also set in
  rosbuild mode.
- Add exported target dependencies in orocos_configure_xxx() macros
  consistently (#244).
…the full macros

The installation directory (AC_INSTALL_DIR) is unknown in the
orocos_configure_xxx() macros because installation is handled by the user.

All the *_EXPORTED_* variables are only needed to find the libraries and include
directories of one package when using orocos_find_package() or orocos_use_package()
in another package that is built within the same build-space, e.g. when using
catkin_make. In all other cases the libraries and their paths are written to and
loaded from the pkg-config (.pc) files, either in the devel-space (for isolated
builds without installation, e.g. catkin_make_isolated or catkin_tools) or
installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant