Difference between "_generate_messages_cpp" and "_exported_targets"

asked 2017-02-17 11:59:51 -0600

OMC gravatar image

Hello,

I am gathering all my messages in a single package (named, say, "my_msgs") to simplify package dependencies, (a well-known ROS good practice).

I realised that some packages add dependencies to my_msgs package using the line

add_dependencies(target my_msgs_generate_messages_cpp)

in the CMakeLists.txt, while others use

add_dependencies(target ${catkin_EXPORTED_TARGETS})

which is how the documentation indicates this should be done. I haven't found much relevant information about the "_generate_messages_cpp" variable, so I wanted to know: is there any difference? Is the second method preferred over the first one?

edit retag flag offensive close merge delete

Comments

I am gathering all my messages in a single package [..] (a well-known ROS good practice)

A comment: putting all your msgs in a single pkg is not necessarily 'good practice'. Msgs should be put together when it makes sense (ie: because of cohesion), not because it's "convenient" or simpler.

gvdhoorn gravatar image gvdhoorn  ( 2017-02-18 05:04:45 -0600 )edit