1.卸载之前的cmake
yum erase cmake
2.安装gcc等必备程序包(已安装则略过此步)
yum install -y gcc gcc-c++ make automake
3.安装wget (已安装则略过此步)
yum install -y wget
4.获取CMake源码包
wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz
5.解压CMake源码包
tar -zxvf cmake-3.15.5.tar.gz
6.进入目录
cd cmake-3.15.5
7.编译安装
./bootstrap && make -j4 && sudo make install
8.建立软连接
ln -s /usr/local/bin/cmake /usr/bin/
9.测试
cmake --version