首页 > 解决方案 > 如何修复 CMake 错误:源目录

问题描述

我正在尝试使用 CMake 编译简单的 c++ 文件,但出现以下错误:CMake 错误:源目录“/home/john/Desktop/example”似乎不包含 CMakelists.txt

john@john:~/ Desktop/sample$ ls
CMakelists.txt hello.cpp
john@john:~/ Desktop/sample$ cmake .
CMake Error: The source directory "/home/john/Desktop/example" does not appear to contain CMakelists.txt

我已经检查过其他有关此的帖子,但没有一个可以帮助我解决它

标签: c++makefilecmake

解决方案


正如@JesperJuhl 指出的那样,问题在于大写。感谢大家的贡献。

suppose to be CMakeLists.txt not CMakelists.txt 

对于这种不必要的问题,我真的很抱歉。不过下次我会更小心的


推荐阅读