shellcommand-linecmake

How do I install CMake?


I've downloaded and unzipped the CMake ZIP file, so that I now have this folder, cmake-3.20.1-windows-x86_64, on my C: drive. But when I try to run CMake commands from the command line, I get this error:

Cmake is not recognized as an internal or external command

I tried adding it to the path like so:

set PATH=C:\cmake-3.20.1-windows-x86_64\bin%PATH%

But then when I try to use CMake again, I get the same error as before.

What do I need to do for CMake to work on the command line?


Solution

  • You should download the Windows installer, available here under Binary distributions. You need the x86_64 installer if you're on a 64-bit Windows version, or the i386 installer if you're on a 32-bit Windows version (this should also work on 64-bit Windows versions).

    For setting the path, see this question.