# Revision history [back]

The catkin message documentation describes how to do this. You can have messages in the same package as your executable, or in another package. In either case, if you're building with catkin_make, you need to tell cmake about the dependency between your C++ code and the messages.

If your messages are in the same package, you can use:

add_dependencies(your_program ${${PROJECT_NAME}_EXPORTED_TARGETS})


If you use messages from a different package, you can use:

add_dependencies(your_program \${catkin_EXPORTED_TARGETS})


If you use messages from other packages and your package, you will need both of those.