背景
尝试编译一个项目被提示:
CMake 3.10 or higher is required. You are running version 2.8.12.2
尝试yum卸载当前的cmake重新用yum安装,发现装的还是2.X版本的cmake
方案
下载最新源码自己自行编译安装
下载cmake源码: https://cmake.org/download/
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
编译源码&安装cmake
tar zxvf cmake-3.* cd cmake-3.* ./bootstrap --prefix=/usr/local make -j$(nproc) make install ln /usr/local/bin/cmake /usr/bin/cmake
检查安装
[root@localhost cmake-3.12.3]# cmake --version cmake version 3.12.3 CMake suite maintained and supported by Kitware (kitware.com/cmake).
参考资料:
https://gist.github.com/1duo/38af1abd68a2c7fe5087532ab968574e