orocos-toolchain/rtt — pull request #79 by meyerj (2014-12-10 20:52:57+00:00)
Title: Extended DESTDIR support for packages built in the same workspace

The first patch extends and simplifies the DESTDIR support introduced in 85fc9d3. It should have no effect on normal builds where the DESTDIR environment variable is not set.

The original patch assumed that DESTDIR is already set during the configure step, like with
```
DESTDIR=/tmp/destdir catkin_make_isolated --install ...
```

In a pure catkin workspace, packages can be built for a whole workspace with a standard debian/rules file and debhelper's support for the cmake build system. In this case DESTDIR is only set during the install step
and the previous patch was not effective, causing RPATH-related errors during runtime.

The INSTALL_RPATH is still constructed based on the information from the pkg-config files for packages in *overlayed* workspaces or system packages. Additionally, libraries built in the *same* workspace will now export their library dirs in the *install-space* via the cmake cache so that other targets that link to it can already set their RPATH correctly.

In order to make sure that no paths within DESTDIR end up in the installed RPATH of any library, a new cmake macro `orocos_set_install_rpath(target rpath)` has been introduced that cleans up all entries in the rpath list and removes duplicates. This could be an issue if RTT itself is installed in DESTDIR together with other packages, as `OROCOS-RTT_LIBRARY_DIRS` would have the DESTDIR prefix.

The second patch reverts @jbohren's 40bbd08 (UseOrocos: adding pkg-config path for catkin workspaces which have yet to be source'd).
It should not be required anymore to add the pkg-config folder in the devel-space to the `PKG_CONFIG_PATH` as packages in the same cmake workspace are found by the `${PACKAGE}_EXPORTED_OROCOS_*` cmake variables now. I removed it because it also breaks DESTDIR builds as packages might be found in the build folder. If it is still required for some reason that I am currently not aware of we could at least add a check if `CATKIN_DEVEL_PREFIX` is within the build directory.