卸载当前旧版本的cmake

通过下面命令查看当前的cmake版本

cmake --version

若版本较旧,执行apt remove 卸载旧版的cmake
若当前系统无cmake,可跳过这一步

sudo apt remove cmake

下载cmake

cmake官网:https://cmake.org/download/

sudo apt-get install -y build-essential libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2.tar.gz
tar -zxvf cmake-3.19.2.tar.gz

配置cmake

cd cmake-3.19.2/
./bootstrap

然后编译安装:

make
sudo make install
hash -r

这样就ok了,检查一下cmake的版本:

cmake --version

可以看到cmake版本为3.19.2

Last modification:July 29th, 2021 at 04:46 pm