Ubuntu18升级cmake3.10到cmake3.18
1、下载cmake版本3.18
wget -O cmake-3.18.2.tar.gz https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz
2、解压cmake
tar zxvf cmake-3.18.2.tar.gz
3、进入cmake进行编译
cd cmake-3.18.2
4、配置cmake
./bootstrap
5、make
make
6、make install
make install
7、软链接
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
出现一下提示
update-alternatives: using /usr/local/bin/cmake to provide /usr/bin/cmake (cmake) in auto mode
如果没有执行第7步,查看cmake版本,会出现如下
执行cmake -version后,
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/share/cmake-3.10
cmake version 3.10.2
执行第7步后
执行cmake -version后,
cmake version 3.18.2