Linking problem with catkin

Hello all,

I'm trying to properly include this package's msgs using catkin on indigo
(and toolchain 2.8):
https://github.com/RCPRG-ros-pkg/lwr_hardware/blob/hydro-devel/lwr_fri/C...

This package contains 2 orocos components and some ros messages. I'm only
interested about the generated messages.
In my package.xml I have :

<build_depends>rtt_ros<build_depends>
<build_depends>lwr_fri<build_depends>

My CMakeLists is basically this one :
https://github.com/jhu-lcsr/rtt_ros_examples/blob/master/rtt_ros_integra...

I get an error :
Target "lwr_fri_generate_messages_cpp" of type UTILITY may not be linked
into another target. One may link only to STATIC or SHARED libraries, or
to executables with the ENABLE_EXPORTS property set.

I can bypass that error using OROCOS_NO_AUTO_LINKING, but then I can't have
access to the messages headers. USE_OROCOS_INCLUDE_DIRS does not contain
the lwr_fri folder, and catkin_INCLUDE_DIRS neither as I did not put it in
find_package (as requested by rtt_ros_integration tuto). If I add it to
find_package, same error as above.

Is this a bug in UseOROCOS-RTT.cmake?
Thanks in advance,

Antoine Hoarau

Re: Linking problem with catkin

I sorta-fixed the error by adding lwr_fri to findpackage(catkin... (so that I have the exported include path for the generated messages) and I put back auto-linking.

Also, I had to add those lines in USEOROCOS-RTT.cmake:

# Line 985
    if(ORO_USE_CATKIN)
        if(${PROJECT_NAME}_EXPORTED_LIBRARIES)
                list(REMOVE_ITEM ${PROJECT_NAME}_EXPORTED_LIBRARIES ${PROJECT_NAME}_generate_messages_cpp)
                list(REMOVE_ITEM ${PROJECT_NAME}_EXPORTED_LIBRARIES ${PROJECT_NAME}_generate_messages_lisp)
                list(REMOVE_ITEM ${PROJECT_NAME}_EXPORTED_LIBRARIES ${PROJECT_NAME}_generate_messages_py)
        endif()
    endif()