Parse error. Expected a command name, got unquoted argument with text
cmake 出现错误提示:
Parse error. Expected a command name, got unquoted argument with text " cmake_minimum_required".
无论CMakeList.txt的第一行指令是什么,运行cmake都这样提错。把txt文件设置为了utf-8的bom编码,修改为utf-8编码即可(对应的是第二条的理由)
CMakeLists.txt 一般有以下三种解决办法:
1、Cmake 升级;
2、utf8编码的bug: vim 打开
:set nobomb
:wq
或者使用 tail 命令:
tail -c +4 old_file > new_file
3、查看代码每行末尾是否有多余空格(复制来的代码末尾有空格);