How to install CMake on CentOS 8

How to install CMake on CentOS 8

Install CMake on CentOS 8

CMake is a free, open source, cross-platform family of tools designed to build, test, and package software. Created by kitware for a powerful cross-platform build environment for open source projects such as VTK and ITK. In this tutorial, you will learn how to install CMake on CentOS 8.

Precondition

Before you begin installing CMake on CentOS 8, your system must have a non-root user account with sudo privileges.

Install the latest version of CMake

CentOS Global Repository does not provide the latest version of CMake. Here, CMake is installed by first downloading and then installing.

First, press to open the terminal Ctrl+Alt+t On CentOS system.

download now CMake To follow wget Terminal commands:

wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz

Unzip the downloaded file cmake-3.15.2.tar.gz Using file tar command:

tar -zxvf cmake-3.15.2.tar.gz

Navigate to the extracted directory using cd Commands such as:

cd cmake-3.15.2

Next run bootstrap The file to bootstrap cmake Enter the following command in a terminal:

./bootstrap

Run make command:

make

install cmake using make The following command:

sudo make install

Confirm installation

Next, check the installation, cmake Version to enter the following command in terminal:

cmake --version

Install the latest version of CMake using SnapCraft

Run the following command to install CMake using SnapCraft

sudo yum install epel-release
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install cmake --classic

Conclusion

You learned how to install CMake on CentOS 8. If you have questions about this, don’t forget the comments below.

Sidebar