一、下载
curl -OL curl -OL https://ghproxy.com/https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0.tar.gz
curl -OL https://ghproxy.com/https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0-SHA-256.txt
sha256sum -c --ignore-missing cmake-3.18.0-SHA-256.txt #会显示cmake-3.18.0.tar.gz: OK
tar -xzvf cmake-3.18.0.tar.gz
二、编译
cd cmake-3.18.0
./bootstrap
报错:
解决方法:
sudo apt install gcc
又报错:
解决方法:
sudo apt-get install build-essential
又报错:
解决办法:
sudo apt-get install libssl-dev
再继续:
./bootstrap
make
make install
报错:
解决办法:
sudo make install
三、配置环境变量
cd bin
pwd
cd
vim .bashrc
source .bashrc
cmake --version