如何安装 cmake?

How do I install cmake?

所以我已经下载并解压缩了 cmake zip,这样我的 C 盘上就有了这个文件夹 cmake-3.20.1-windows-x86_64。但是当我尝试从命令行执行 运行 cmake 命令时,出现此错误,“Cmake 未被识别为内部或外部命令。”

我试过将它添加到路径中 set PATH=C:\cmake-3.20.1-windows-x86_64\bin%PATH% 但是当我再次尝试使用 cmake 时,我得到了和以前一样的错误。

我需要做什么才能让 cmake 在命令行上工作?

您应该下载 Windows 安装程序,如果您使用的是 32 位 Windows 版本,则可用 here under Binary distributions. You need the x86_64 installer if you're on a 64-bit Windows version, or the i386 安装程序(这也适用于 64 位 Windows 版本).

设置路径见this问题。