ROS中cmakelist与C++中有所不同,稍作记录。
首先是顺序
cmakelist撰写顺序
Required CMake Version (cmake_minimum_required) //cmake版本
Package Name (project()) //包的名字,也是项目名字,并且可以在之后需要使用项目名称时用${PROJECT_NAME} 替代,好处是,改变项目名字时,只需要改变这里的名字,后续的都会改变。
Find other CMake/Catkin packages needed for build (find_package()) //查找依赖包,并且给出找到包的导出路径、库文件等。
Enable Python module support (catkin_python_setup())
Message/Service/Action Generators(add_message_files(), add_service_files(), add_action_files())
Invoke message/service/action generation (generate_messages())
Specify package build info export (catkin_package())
Libraries/Executables to build (add_library()/add_execu