Cmake multi-version coexistence and switching

1. Do not delete the previously installed Cmake and download the new version of Cmake.

Download address of Cmake official website

2. Unzip the software package

# cmake可执行性文件
/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin/cmake

# cmake-gui界面
/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin/cmake-gui

3. Configure environment variables

gedit ~/.bashrc

# 添加内容,PATH路径根据真实路径
export PATH=/home/yoyo/360Downloads/cmake-3.21.1-linux-x86_64/bin:$PATH

# 更新bashrc
source ~/.bashrc

4. Check whether the installation is successful

cmake --version

Guess you like

Origin blog.csdn.net/weixin_37950717/article/details/125222780