CentOS安装CMake

CentOS6.5自带的CMake版本过低,利用官方提供的二进制文件安装最新版本的CMake。

1、如有必要,移除已安装的CMake
2、下载二进制文件
wget --no-check-certificate https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.sh
3、解压到 /opt 目录
chmod a+x cmake-3.11.1-Linux-x86_64.sh
./cmake-3.11.1-Linux-x86_64.sh --skip-license --prefix=/opt --include-subdir
最终Cmake位于/opt/cmake-3.11.1-Linux-x86_64目录
4、建立软连接
ln -s /opt/cmake-3.11.1-Linux-x86_64/bin/cmake /usr/bin/cmake
5、验证
[root@localhost ~]# cmake --version
cmake version 3.11.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

猜你喜欢

转载自my.oschina.net/u/988775/blog/1802122