下载CMake安装包

请从下载也选择合适的二进制包(Binary distributions)

安装

假设下载文件为:cmake-3.22.0-linux-x86_64.tar.gz

snippet.bash
tar --strip-components=1 -xf cmake-3.22.0-linux-x86_64.tar.gz -C /usr/local
cd /usr/local/bin
ln -s cmake cmake3

验证

snippet.bash
[root@localhost ~]# cmake --version
cmake version 3.22.0
 
CMake suite maintained and supported by Kitware (kitware.com/cmake).