执行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