ROS CMakeLists.txt的编写

 CMakeLists.txt是CMake的构建系统构建软件包的输入文件。任何兼容的CMake都包含了描述如何构建代码,并在根目录及子目录进行安装到一个或多个的CMakeLists.txt文件。


  1. Required CMake Version (cmake_minimum_required)//cmake版本

  2. Package Name (project()) //项目名称

  3. Find other CMake/Catkin packages needed for build (find_package()) //需要的库文件,调用ROS,至少需要catkin的依赖库

  4. Message/Service/Action Generators (add_message_files(), add_service_files(), add_action_files()) //输出的信息,服务,及生成的东西

  5. Invoke message/service/action generation (generate_messages()) //生成信息~~~

  6. Specify package build info export (catkin_package()) //catkin的库文件

  7. Libraries/Executables to build (add_library()/add_executable()/target_link_libraries()) //库文件,生成文件及路径

  8. Tests to build (catkin_add_gtest())

  9. Install rules (install())

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation)

add_message_files(
  FILES
  Num.msg
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

修改完以后,需要重新编译我们的package

$ roscd beginner_tutorials
$ cd ../..
$ catkin_make install
$ cd -


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值