Attention: Answers.ros.org is deprecated as of August the 11th, 2023. Please visit robotics.stackexchange.com to ask a new question. This site will remain online in read-only mode during the transition and into the foreseeable future. Selected questions and answers have been migrated, and redirects have been put in place to direct users to the corresponding questions on Robotics Stack Exchange. Additional details are available here.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/test/tests.cmake:114 (add_dependencies):
Cannot add target-level dependencies to non-existent target
"_run_tests_mynode".
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.
Call Stack (most recent call first):
The name of the node was run_tests_mynode, the cryptic error goes away and compiles fine once you rename you node to something that does not include run_tests_ as its starting of the name. Probably a bug but I posted here for visibility since I wasted about 45 mins in this issue myself.