orocos-toolchain/rtt — pull request #20 by meyerj (2013-12-15 13:07:49+00:00)
Title: More UseOROCOS-RTT.cmake updates

**The patches in this pull request are very experimental and need extensive testing!**

All patches could be applied independently. I built rtt_ros_integration and some catkin and rosbuild packages without problems, but especially the auto-linking patch (4b7fc9749e3ee366dc8620b2a090974eb4d44004) has to be tested on different platforms and with different compilers.

* https://github.com/meyerj/rtt/commit/7e561cc363ab9b2bbdb2492175202392be8a17df: adds a guard to not parse `UseOROCOS-RTT.cmake` twice. This is only a minor issue and suppresses duplicate output messages due to multiple direct and indirect includes in the same package, e.g. for typekit / service proxy packages.

* https://github.com/meyerj/rtt/commit/95ac8857e9705d86bb18c2c055e15122e471576c: can be considered a bug fix. Due to the renamed `USE_OROCOS_COMPILE_FLAGS` and `USE_OROCOS_LINK_FLAGS` variables and the set commands in [UseOROCOS-RTT-helpers.cmake:347](https://github.com/meyerj/rtt/blob/4b7fc9749e3ee366dc8620b2a090974eb4d44004/UseOROCOS-RTT-helpers.cmake#L347) the initial settings in [UseOROCOS-RTT.cmake:55](https://github.com/meyerj/rtt/blob/4b7fc9749e3ee366dc8620b2a090974eb4d44004/UseOROCOS-RTT.cmake#L55) are overridden by the `orocos_use_package()` macro. I replaced them with the new names `USE_OROCOS_CFLAGS_OTHER` and `USE_OROCOS_LDFLAGS_OTHER`. Or do you prefer to keep the old names?

* https://github.com/meyerj/rtt/commit/b39f12bcfe5cffd0323cfaec2ce429df2fd45e1f: `LINK_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )` seems to be an remnant from the very beginning of UseOROCOS-RTT.cmake and is obviously not required any more.

* https://github.com/meyerj/rtt/commit/4b7fc9749e3ee366dc8620b2a090974eb4d44004: changes the way the auto-linking is done. Instead of using the deprecated `link_libraries()` cmake command to link all targets to the `USE_OROCOS_LIBRARIES`, only the targets created with the `orocos_*()` macros will link automatically unless `OROCOS_NO_AUTO_LINKING` is set. Another advantage is that auto-linking can still be disabled or enabled after `UseOROCOS-RTT.cmake` has been included.

Furthermore, I do not see a good reason not to enable auto-linking by default in catkin builds if it works like this and has no effect on non-Orocos targets. It has been disabled in https://github.com/jhu-lcsr-forks/rtt/commit/071e19778bd4fb5fc5abc1246e435bfd6fc35de8, I guess in order to mimic the need for explicit linking to `${catkin_LIBRARIES}` in catkin. But especially if catkin is only used as a build-tool and a package has no dependencies to non-Orocos packages there is no reason to break the meaning of `orocos_use_package()` or to confuse users with different effects for different build systems.