
There is some nuance here.
Yes, the CMakeLists.txt will need to be updated if you add system dependences to your package.xml, but only if that dependency is actually used at build time (and if it's actually C++ (or some other compiled language) we're targeting).
So if a dependency does not provide headers or libraries, or some other artefact or piece of build infrastructure (like preprocessors, code generators, etc), CMakeList.txt would probably not need to be updated.
Having said that: the example shown on the page you linked to would seem to be a case where CMakeLists.txt would need to be updated -- assuming obviously that the dependency (ie: headers, libraries) are used by any of the C++ sources that are being build.
Originally posted by gvdhoorn with karma: 86574 on 2017-07-12
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by Blupon on 2017-07-24:
for example: to add depency of a package to tf sensor_msgs std_msgs to publish a jointState (like seen on this tutorial), do I need to edit the CMakeLists.txt ? Build infrastructure is new to me ^^
Comment by gvdhoorn on 2017-07-24:
Yes. Whenever you use something 'new' in your code -- and that 'something' is not something that is local to your own pkg, you'll need to add it to your manifest and update the CMakeLists.txt.
Note that this is not ROS specific. The same would be needed in a regular CMake project.
Comment by gvdhoorn on 2017-07-24:
See also: catkin 0.7.6 documentation » How to do common tasks » Package format 2 (recommended).