3
$\begingroup$

I've read this link: https://answers.ros.org/question/217475/cmakeliststxt-vs-packagexml/

But still, I can't understand very clearly.

When I try to compile ROS project with the command: catkin_make --install, how and when is the package.xml used? how and when is the CMakeLists.txt used? Both of them must be used?

$\endgroup$
2
$\begingroup$

Regarding CMakeLists.txt, it

is the input to the CMake build system for building software packages.

You can think of this file as simply being a list of the cmake build targets and commands for your specific package. It may help to read this to get a general idea.

For package.xml, it

defines properties about the package such as the package name, version numbers, authors, maintainers, and dependencies on other catkin packages.

EDIT: According to an answer in How do I write package.xml? the package.xml is used during the install process to help resolve dependencies.

If you are missing any dependencies and they are not listed in the package.xml file before running catkin_make --install, then your build will either fail or not work as expected.

$\endgroup$
  • $\begingroup$ If Package.xml is not used by catkin_make to build or install, what is it used for? only for human reading? $\endgroup$ – Yves Jul 4 '18 at 10:37
  • $\begingroup$ @Yves, package.xml is used to resolve dependencies when installing. Aside from the installation process, the file can be used for human reading. $\endgroup$ – koverman47 Jul 4 '18 at 19:32

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.