In our system with >100 custom packages, there are >20 custom_msgs packages which provide for communication between packages. This question concerns correctly setting up CMakeLists.txt so the necessary messages get built before packages that depend on them.
The Defining Custom Messages tutorial shows how to declare build and exec dependencies in package.xml, and also says you need to declare a build dependency on message_generation and an exec dependency on message_runtime - this all makes sense.
The tutorial states you need to add the following to CMakeLists.txt:
find_package(message_generation)
catkin_package(CATKIN_DEPENDS message_runtime)
add_message_files(FILES your_msg_file.msg)
Is the last line correct? I understand add_message_files is needed in the package that declares the messages, but is it really also needed in packages that use the messages in the custom_msgs package? That would imply that every package that uses a custom message would need to list the messages it uses - it doesn't seem right.
Does the last line need to be deleted from the tutorial?
Originally posted by PaulBouchier on ROS Answers with karma: 300 on 2018-04-25
Post score: 0