一,移除旧版本
yum remove cmake -y
二,下载安装
wget https://cmake.org/files/v3.25/cmake-3.25.3.tar.gz
tar xvf cmake-3.25.3.tar.gz
cd cmake-3.25.3
./bootstrap --prefix=/usr/local/cmake
make
make install
三,创建软连接
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake
四,查看版本
cmake -version
其他
在CentOS7.x准备编译cmake的时候,configure报错
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
解决:
yum -y install openssl-devel