centos 7安装cmake

wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz   # 或者从https://cmake.org/files/v3.15/下载
tar -zxf cmake-3.15.5.tar.gz
cd cmake-3.15.5
./bootstrap --prefix=/usr --datadir=share/cmake --docdir=doc/cmake && make
# 如果只在普通用户下面安装,prefix设置成自己的目录,make install 也不用sudo。安装完之后,cmake的可执行文件在prefix目录下面的bin中
sudo make install
# 检查是否安装成功
cmake --version

参考:
[1] CentOS 7 安装 CMake 3.15.5

你可能感兴趣的:(centos 7安装cmake)