# CMakeLists.txt vs package.xml

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?

## 1 Answer

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.

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