Ask Your Question

Revision history [back]

When you created your package with roscreate-pkg (as shown in this tutorial:, it should have created the required Makefile for you. Since you don't have one, you technically have have a malformed ROS package, which is why rosmake won't build it.

Either regenerate your package using roscreate-pkg or just create a Makefile in your package with the following contents:

include $(shell rospack find mk)/

Also for things like OpenCV you should look into using standard find_package syntax as opposed to going through pkg-config.

Here's an example snippet from the CMakeLists.txt of a package using that approach:

find_package(OpenCV REQUIRED)

rosbuild_add_executable(dilation_sample src/dilation_sample.cpp)
target_link_libraries(dilation_sample ${OPENCV_LIBS})

You may find a similar find_package module is provided by CMake or GTK for using GTK libriaries in a CMake project.