Installing CMake

There are several ways to install CMake, depending on your platform.

Windows

There are pre-compiled binaries available on the Download page for Windows as MSI packages and ZIP files.

One may alternatively download and build CMake from source. The Download page also provides source releases. In order to build CMake from a source tree on Windows, you must first install the latest binary version of CMake because it is used for building the source tree. Once the binary is installed, run it on CMake as you would any other project. Typically this means selecting CMake as the Source directory and then selecting a binary directory for the resulting executables.

Linux, Mac OS, UNIX

There are pre-compiled binaries available on the Download page for some UNIX platforms.

One may alternatively download and build CMake from source. The Download page provides source releases.  There are two possible approaches for building CMake from a source tree.  If there is no existing CMake installation, a bootstrap script is provided:

  ./bootstrap
  make
  make install

(Note: the make install step is optional, cmake will run from the build directory.)

For more options with bootstrap, run ./bootstrap --help

Or, an existing CMake installation can be used to build a new version:

  cmake .
  make      
  make install

(Note: the make install step is optional, cmake will run from the build directory.)

If you are not using the GNU C++ compiler, you need to tell the bootstrap script (or cmake) which compiler you want to use. This is done by setting the environment variables CC and CXX before running it. For example:

  env CC=cc CXX=CC ./bootstrap
  make
  make install