1、cmake下載
鏈接:https://cmake.org/download/
2、解压与环境变量设置
tar -zxvf cmake-3.22.0-linux-x86_64.tar.gz
sudo mv cmake-3.22.0-linux-x86_64 /opt
# 在~/.bashrc 和/etc/profile添加cmake的环境变量设置
sudo gedit ~/.bashrc
sudo gedit /etc/profile
# export CMAKE_HOME=/opt/cmake-3.22.0-linux-x86_64
# export PATH=$CMAKE_HOME/bin:$PATH
或者:sudo ln -s /opt/cmake-3.22.0-linux-x86_64/bin/cmake /usr/bin/cmake
cmake --version