

We have three ways to install latest version of CMake: use a package manager (like YUM/DNF) to download and install automatically from custom repositories, or install manually from generic binary distribution, or install manually from source compilation.Īll these ways have pros and cons. Please note that on CenOS 8, CentOS Stream 8 and later versions of CentOS, yum command is a symbolic link to dnf binary and was replaced by dnf command. We will use yum command for any package related operation. If you are not the root user, please make sure to add “sudo” before each command, or switch to the root user by command below: sudo -s If you need CMake to compile and install software on CentOS, but the CMake version installed by package manager Yum or DNF does not meet the requirement, you can follow this article to quickly install latest CMake in best practices.Ī root user role is required to follow the commands in this article. Problems that you may encounter during compilation are also specified in detail. The full process has been tested as working on CentOS 7, CentOS 8, and CentOS Stream 8.

#CENTOS 7 INSTALL CMAKE HOW TO#
We will use the currently latest stable version 3.22.2 of CMake as an example to show how to install CMake on CentOS. CMake is used to control the software compilation process using native platform and compiler-independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is an open-source, cross-platform family of tools designed to build, test and package software.
