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

rospack export does not list all include directories

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

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 cmake.mk file according to something like this:

.PHONY: check-syntax
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 cmake.mk file?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

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 cmake.mk does.

edit flag offensive delete link more

Question Tools

Stats

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

Seen: 290 times

Last updated: Dec 20 '12