How to install cmake?
CMake is a cross-platform tool for building, testing and packaging software.
If you’ve been writing C or C++ (or maybe Fortran) you probably had to, at some point, use cmake to package your software.
If you’re a Linux user, you’d normally just need to run:
sudo apt-get install -y cmaketo install it. But sometimes, the version that you can install from the official repository is not the one you need.
Therefore, you will probably need to proceed with a manual installation. But before you do that, check the current version to see whether is the one you expect or not:
cmake --versionRemove the current install:
sudo apt-get -y purge --auto-remove cmakeDownload the latest stable release, e.g v3.19.2 (do not download the binary/dmg distribution, but the Linux/Unix source):
wget https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2.tar.gzUnzip the archive:
tar -xzvf cmake-3.16.4.tar.gzBuild and install it:
cd cmake-3.16.4
./bootstrap
make -j$(nproc)
sudo make installVerify the installation:
cmake --versionIf you see something like:
cmake version 3.19.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).you’re good to go.
For other platforms, check the official install guide.