How do I install CMake?

This guide shows you how to install and use the tool with the most common configuration. For advanced options and complete reference information, see the official documentation. Some install guides also include optional next steps to help you explore related workflows or integrations.

CMake is an open-source, cross-platform build tool for software development projects, especially C and C++.

CMake is available on a variety of operating systems and can be installed in different ways. In this guide, you’ll learn how to install CMake for Arm Linux distributions and for Windows on Arm.

Before you begin

If you’re installing CMake for Windows on Arm, ensure you are using a Windows on Arm device such as the Lenovo ThinkPad X13s or Surface Pro 9 with 5G.

If you’re installing CMake for Arm Linux, confirm you are using an Arm computer with 64-bit Linux by running:

    

        
        
uname -m

    

The output is similar to:

    

        
        aarch64

        
    

If you see a different result, you are not using an Arm computer running 64-bit Linux.

Download and install CMake on Windows on Arm

Native CMake support for Windows on Arm is available starting with version 3.24. Emulated CMake can be used but is no longer needed unless you need to use an older version of CMake.

The following steps install CMake version 4.3.1. To find the latest Windows on Arm installer, see CMake download .

To download and install CMake on Windows on Arm, follow these steps:

  1. Download the Windows ARM64 Installer and run it. The welcome screen will appear.

Image Alt Text:A screenshot of the Windows CMake Setup Wizard welcome page that asks the user to click the Next button to contunue with installation.

  1. Click Next and then accept the End-User License Agreement.

  2. Under Install Options, to invoke CMake from any directory, select Add CMake to the system PATH for the current user and then click Next.

  3. Follow the prompts to complete the installation. Wait for the installer to complete and then click Finish. Image Alt Text:A screenshot of the CMake Windows Setup Wizard that shows that the installation is complete and asks the user to click the Finish button to exit the Wizard.

Download and install CMake on Linux

There are multiple ways to install CMake on Linux.

Install CMake using the package manager

On Ubuntu and Debian, use apt:

    

        
        
sudo apt update
sudo apt install cmake -y

    

On Fedora and Amazon Linux 2023, use dnf:

    

        
        
sudo dnf install cmake -y

    
Note

Depending on your Linux distribution, you may have a version of cmake which is too old or too new for your project.

Install CMake with Snap

By installing with snap, you get the latest version of cmake:

    

        
        
sudo snap install cmake --classic

    

With snap, the cmake executable is installed in /snap/bin which should already be in your search path.

Use a specific CMake release from GitHub

To install a specific version of CMake from GitHub, follow these steps:

Note

The following commands use CMake version 4.3.1. The same commands work with other versions. Replace the script used in these steps with the script for your version of choice. To find the latest version, see CMake releases .

  1. Download a release from GitHub:
    

        
        
cd $HOME
wget -N https://github.com/Kitware/CMake/releases/download/v4.3.1/cmake-4.3.1-linux-aarch64.sh

    
  1. Run the install script and set the search path:
    

        
        
mkdir cmake
bash /home/$USER/cmake-4.3.1-Linux-aarch64.sh --skip-license --exclude-subdir --prefix=$HOME/cmake
export PATH=$PATH:$HOME/cmake/bin

    

Verify that CMake is installed

After installing CMake, run it to confirm it is installed and can be found:

    

        
        
cmake

    

The output is similar to:

    

        
        Usage

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>
  cmake [options] -S <path-to-source> -B <path-to-build>

Specify a source directory to (re-)generate a build system for it in the
current working directory.  Specify an existing build directory to
re-generate its build system.

Run 'cmake --help' for more information.

        
    

After confirming CMake can be found, print the version:

    

        
        
cmake --version

    

The output is similar to:

    

        
        cmake version 4.3.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

        
    

You are now ready to use CMake.


Give Feedback

How would you rate this tool quick-install guide?