add_dependencies(listener beginner_tutorials_generate_messages_cpp) explanation
I am currently doing the ROS tutorial on Writing a Simple Publisher and Subscriber (C++). I do not understand the explanation for including this line add_dependencies(talker beginner_tutorials_generate_messages_cpp)
in the package CMakeLists.txt
file. Here is the accompanying explanation of the line:
Note that you have to add dependencies for the executable targets to message generation targets:
add_dependencies(talker beginner_tutorials_generate_messages_cpp)
This makes sure message headers of this package are generated before being used. If you use messages from other packages inside your catkin workspace, you need to add dependencies to their respective generation targets as well, because catkin builds all projects in parallel.
What is headers of the package used by? What is beginner_tutorials_generate_messages_cpp
? Is it the message generation target? What is a message generation target?