yum 安装的CMake版本是 2.8.12.2,比较旧无法使用。那就来升级一下吧。
cmake .
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.8 or higher is required. You are running version 2.8.12.2
下载最新版本
导航页:
https://github.com/Kitware/CMake/releases
目前最新的是:
https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0.tar.gz
这个地址下面的安装命令中会用到。rrgf ,m. cftyj
安装
yum -y install gcc gcc-c++ extra-cmake-modules
wget https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0.tar.gz
tar -zxf cmake-3.21.0.tar.gz
cd cmake-3.21.0
./bootstrap --prefix=/usr --datadir=share/cmake --docdir=doc/cmake && make
sudo make install
检查版本
命令:
cmake --version
执行结果:
cmake --version
cmake version 3.21.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
---------------教程结束-----------------
参考
https://www.24kplus.com/linux/557.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)