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

Revision history [back]

click to hide/show revision 1
initial version

What I did when using opencv was find_package cv_bridge, let catkin depend on it and link against the catkin libraries. It works for me, feel free to down vote this answer if it is not nice ;)

find_package(catkin REQUIRED COMPONENTS cv_bridge roscpp)
catkin_package(
   CATKIN_DEPENDS cv_bridge roscpp
   DEPENDS system_lib
)
target_link_libraries(my_node ${catkin_LIBRARIES})

What I did when using opencv was find_package cv_bridge, let catkin depend on it and link against the catkin libraries. It works for me, feel free to down vote this answer if it is not nice ;)

find_package(catkin REQUIRED COMPONENTS cv_bridge roscpp)
catkin_package(
   CATKIN_DEPENDS cv_bridge roscpp
   DEPENDS system_lib
)
target_link_libraries(my_node ${catkin_LIBRARIES})

Since many libraries will become system dependencies in the long run, this should still work later. In fact I also tried it on a platform where OpenCV was installed outside of ROS and it works