1. https://cmake.org/download/ 找到合适的版本,如3.7.2
2. 进到文件保存路径: /home/wuhui.wwh/tools wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz
3. tar -zxvf cmake-3.7.2.tar.gz
4. 进到 cmake-3.7.2目录下
.bootstrap
make
make
5. 添加环境变量:
vi ~/.bashrc
在最末尾一行: export PATH=$PATH:/home/wuhui.wwh/tools/cmake-3.7.2/bin
6. cmake --version
能看到版本信息说明安装成功。
$cmake --version
cmake version 3.7.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).