Ask Your Question
0

depends on message does not work for my node

asked 2014-05-25 20:27:05 -0500

Jonathan Ruiz gravatar image

Hello,

I have some nodes that uses custom messages that I have in my workspace. In the package.xml I have declared it as depends (build and run), but if I clean the workspace when I use catkin_make to build everything it crash.

The crash is because the compiler try to build the node before generating the message and cannot find header files for the messages.

I think that I forgot something, but I cannot find a solution in the web.

Thanks you very much.

PD: I am using hydro.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-05-26 00:59:11 -0500

fergs gravatar image

The package.xml isn't really used much during the build, what you are looking for is to add dependencies in your CMakeLists.txt. For instance, if you have a target called foo, and a package named my_msgs, you would "add_dependencies":

add_executable(foo src/foo.cpp)
# other link, etc commands
add_dependencies(foo my_msgs_generate_messages_cpp)

This will then cause CMake to build your messages before your node.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-25 20:27:05 -0500

Seen: 64 times

Last updated: May 26 '14