Difference between "_generate_messages_cpp" and "_exported_targets"
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?
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.