查看版本make --version
若版本太低,先卸了:
yum remove cmake -y
查看系统是64位还是32位,选择相应版本下载
getconf LING_BIT
官网下载源码,解压
tar -zxvf cmake-3.21.2-linux-x86_64.tar.gz
进入解压目录
cd cmake-3.21.2-linux-x86_64
配置
./bootstrap --prefix=/use/local/cmake
编绎
make
安装
make install
完成
问题:
cmake找不到版本
编辑.bash_profile
vim .bash_profile
找到export PATH=添加cmake路径
export PATH=$PATH:usr/local/cmake/bin
保存退出
让环境变量在当前命令页面立即生效
source ~/.bash_profile
查看环境变量,看到添加的路径
echo $PATH
查看版本
make --version
cmake version 3.21.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).