从源码安装camke
1. 删除默认的cmake
sudo apt remove cmake
sudo apt purge --auto-remove cmake
2. 从官网下载所需版本,解压,创建build文件夹
version=3.13
build=3
mkdir ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/
3. 编译安装
./bootstrap
make -j4
sudo make install
4. 移动路径
sudo cp ./bin/cmake /usr/bin/
5.验证安装结果
cmake --version
输出:
cmake version 3.13.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).