ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Although the discussion of my original question has changed my approach, here is the answer to my question. Full disclaimer, I'm not an expert at CMake or even c/l flags, so there may be an even better answer.

The export line in the manifest should be changed to the following:

<export> <cpp cflags="-I${prefix}/include -DROS=1" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib" /> </export>

Any package that requires the library now must explicitly state which library it wants to use in CMakeLists.txt, ex:

rosbuild_add_executable(my_exe src/my_exe.cpp)

target_link_libraries(my_exe my_lib) OR target_link_libraries(my_exe my_lib)

Although the discussion of my original question has changed my approach, here is the answer to my question. Full disclaimer, I'm not an expert at CMake or even c/l flags, so there may be an even better answer.

The export line in the manifest should be changed to the following:

<export> <cpp cflags="-I${prefix}/include -DROS=1" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib" /> </export>

Any package that requires the library now must explicitly state which library it wants to use in CMakeLists.txt, ex:

rosbuild_add_executable(my_exe src/my_exe.cpp)

target_link_libraries(my_exe my_lib) OR target_link_libraries(my_exe my_lib)

This goes against the recommended approach here.

Although the discussion of my original question has changed my approach, here is the answer to my question. Full disclaimer, I'm not an expert at CMake or even c/l flags, so there may be an even better answer.

The export line in the manifest should be changed to the following:

<export> <cpp cflags="-I${prefix}/include -DROS=1" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib" /> </export>

Any package that requires the library now must explicitly state which library it wants to use in CMakeLists.txt, ex:

rosbuild_add_executable(my_exe src/my_exe.cpp)

target_link_libraries(my_exe my_lib) OR target_link_libraries(my_exe my_lib)my_lib_alternate)

This goes against the recommended approach here.