在linux系统上编译C++代码时常常出现CMake Error: The source directory "" does not exist
详细报错信息为:
CMake Error: The source directory “” does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:174: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
解决办法:
1.删除build文件夹中的CMakeCache.txt文件(如下图)
linux命令为:
rm CMakeCache.txt
2.执行cmke命令,记住cmke后面有个空格+. 。很多人忽视了这个.导致出现CMake Error。
cmake .
3.最后再执行make即可。