ROS CMakeList.tx配置出错 add_dependencies位置出错

执行catkin_make时出错,错误如下:

CMake Error at test_code/CMakeLists.txt:135 (add_dependencies):
  Cannot add target-level dependencies to non-existent target "test_code".

  The add_dependencies works for top-level logical targets created by the
  add_executable, add_library, or add_custom_target commands.  If you want to
  add file-level dependencies see the DEPENDS option of the add_custom_target
  and add_custom_command commands.


-- Configuring incomplete, errors occurred!
See also "/home/lin/firtst_homework/build/CMakeFiles/CMakeOutput.log".
See also "/home/lin/firtst_homework/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed

错误的原因是,add_dependencies()的位置错了,注意CMakeList.txt文件中,add_exacutable()的上下文都存在add_dependencies(),需要在add_exacutable()的下方add_dependencies()。

错误原文件如下:

## Add cmake target dependencies
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值