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

rospack export does not list all include directories

asked 2012-12-20 11:34:27 -0500

Jlicht gravatar image

Suppose I'd like to retrieve all the build flags to be able to integrate syntax checking into my favorite editor for the package my_vision. I'd need to add a check-syntax target to the file according to something like this:

.PHONY: check-syntax
        gcc -Wall -fsyntax-only $(shell rospack export --lang=cpp --attrib=cflags) $(CHK_SOURCES)

rospack export does not list /home/me/ros/my_vision/include as a include directory, even though the headers I've place here will still be found during compilation. So:

  1. How does the ROS build system find my custom header files?

  2. Can I also use this functionality in the file?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-20 11:58:58 -0500

tfoote gravatar image

Your approach is going to run into some issues.

rospack exports are manually written in your manifest.xml. They are the include directories which you need to export to packages which depend on your package. This is not necessarily all include directories needed to compile the package itself.

If you need include directories in your own package you should be using include_directories in your CMakeLists.txt

And the correct thing to do is to add the target you want in cmake, and then have the makefile invoke cmake && make mytarget like does.

edit flag offensive delete link more

Question Tools


Asked: 2012-12-20 11:34:27 -0500

Seen: 280 times

Last updated: Dec 20 '12