catkin_package解析

catkin_package与find_package
https://cloud.tencent.com/developer/ask/183702

ROS Catkin 教程之 catkin_package(...) 到底在做什么?
https://blog.csdn.net/lcc816/article/details/82962561

https://answers.ros.org/question/58498/what-is-the-purpose-of-catkin_depends/
https://blog.csdn.net/lcc816/article/details/82949880

在文件CMakelists.txt中我看到find_packages和catkin_package:

find_package(catkin REQUIRED COMPONENTS roscpp rospy image_transport std_msgs message_generation sensor_msgs geometry_msgs) catkin_package(CATKIN_DEPENDS message_runtime std_msgs sensor_msgs geometry_msgs)

这两件事有什么区别?

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS ...
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(...

find_package命令是常见的cmake,需要加载catkin宏并指定其他ROS包的依赖关系。
catkin_package命令是这些catkin宏之一。它负责包的ROS特定配置。因此,这是将ROS包与常见的cmake项目区分开来的重要部分。我不知道细节,但我想,例如,它负责设置catkin工作区的正确构建路径。 当其他ROS包依赖于此包时,这里给出的参数(即依赖性)很重要。

catkin_package解析_第1张图片

catkin_package中添加的包,必须在package.xml中指定依赖
 

你可能感兴趣的:(cmake)