What dependencies to specify in CMakeLists.txt and which to specify in package.xml?
Even after having read this post regarding the difference between CMakeLists.xml
and package.xml
files (in the ROS context), I'm still not sure which dependencies should be specified in one or the other file.
I thought I needed to include (at least) in find_package
(of the CMakeLists.xml
) all the build dependencies (what about the other dependencies?) specified in the corresponding package.xml
file, but this isn't the case, since I have a package where I'm specifying rospkg
as a <build_depend>
in package.xml
, but if I also include rospkg
in find_packages
it gives me an error of the form
Could not find a package configuration file provided by "rospkg" with any of the following names:
rospkgConfig.cmake rospkg-config.cmake
On the other hand, a package like rospy
also contains C++ code and I can include it in the find_package
list.
The reason to have a package.xml
and also a CMakeLists.txt
is mainly due to, I guess, the need to support Python and C++ in ROS, but it's not very clear, again, which dependencies need to be specified in which files.
I checked the Github repository for rospkg
and, indeed, it does not contain any C++ files (if I checked correctly), and thus it wouldn't make much sense to include rospkg
in CMakeLists.xml
...