由于使用的系统是centos7,所以一些yum源里的rpm包比较旧,需要手动编译
cd /usr/local/src/
wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
tar xvzf cmake-3.20.2.tar.gz
cd cmake-3.20.2
./configure --prefix=/data/apps/cmake
make && make install
ln -s /data/apps/cmake/bin/* /usr/bin/
cmake参数说明