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.