1、下载最新版
cmake官网下载包地址:https://cmake.org/download/
wget -c https://github.com/Kitware/CMake/releases/download/v3.28.1/cmake-3.28.1.tar.gz
tar -zxvf cmake-3.28.1.tar.gz
2、删除旧版本CMake
yum remove cmake -y
3、编译
./configure --prefix=/usr/local/cmake
make && make install
4、建立软链
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake
5、查看版本
cmake -version
评论