Reading time: | 10 min |
Last updated: | 14 May 2024 |
Reading time: |
10 min |
Last updated: |
14 May 2024 |
Author: | Jason Andrews, Arm |
Official docs: | View |
Tags: |
Author: |
Jason Andrews, Arm |
Official docs: |
View |
Tags: |
This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.
CMake is an open-source, cross-platform build tool for software development projects, especially C and C++.
It is available for a variety of operating systems and there are multiple ways to install it.
This article provides quick instructions to install CMake for Arm Linux distributions and for Windows on Arm.
Confirm you are using a Windows on Arm device such as Windows Dev Kit 2023 or a laptop such as Lenovo ThinkPad X13s or Surface Pro 9 with 5G.
Confirm you are using an Arm computer with 64-bit Linux by running:
uname -m
The output should be:
aarch64
If you see a different result, you are not using an Arm computer running 64-bit Linux.
Native CMake support for Windows on Arm is available starting with version 3.24. Installers are available now from the CMake download page. Emulated CMake can be used but is no longer needed unless an older version of CMake must be used.
Download the Windows ARM64 Installer and run it.
The welcome screen will appear:
Accept the End-User License Agreement.
Check Add CMake to the system PATH for the current user
if you want to easily invoke cmake from any directory.
Follow the prompts to complete the installation.
Wait for the installer to complete and click Finish
:
There are multiple ways to install CMake on Linux.
Use apt
on Ubuntu and Debian to install:
sudo apt update
sudo apt install cmake -y
Use dnf
to install on Fedora and Amazon Linux 2023:
sudo dnf install cmake -y
Depending on your Linux distribution you may have a version of cmake
which is too old or too new for your project.
Installing with snap
provides 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.
If you need a specific version look for it in the GitHub releases area
Substitute the release number you want to install in the commands below..
cd $HOME
wget -N https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1-Linux-aarch64.sh
mkdir cmake
bash /home/$USER/cmake-3.28.1-Linux-aarch64.sh --skip-license --exclude-subdir --prefix=$HOME/cmake
export PATH=$PATH:$HOME/cmake/bin
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.
To print the version run:
cmake --version
The output is similar to:
cmake version 3.28.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
You are ready to use CMake.
How would you rate the overall quality of this tool quick-install guide?
What is the primary reason for your feedback ?
Thank you. We're grateful for your feedback on how to improve this tool quick-install guide.