这是我的报错:
CMake Error at server_client/CMakeLists.txt:137 (add_dependencies):
Cannot add target-level dependencies to non-existent target "demo_server".
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.
具有普遍性的一句话是:
CMake Error at ?????/CMakeLists.txt:????? (add_dependencies):
Cannot add target-level dependencies to non-existent target "?????".
其中问号是根据路径和文件变化的。
原因:
CMakeList.txt文件中add_executable前后都有add_dependencies,如果只认add_dependencies来进行配置的话很容易出现错误。
修改:(注意add_