一、下载CMake
二、解压安装
tar -zxvf cmake-3.24.2-linux-x86_64.tar.gz
添加环境变量
shuchengyang@shuchengyang-virtual-machine:~/cmake-3.24.2-linux-x86_64$ ls bin doc man share shuchengyang@shuchengyang-virtual-machine:~/cmake-3.24.2-linux-x86_64$ cd bin/ shuchengyang@shuchengyang-virtual-machine:~/cmake-3.24.2-linux-x86_64/bin$ ls ccmake cmake cmake-gui cpack ctest shuchengyang@shuchengyang-virtual-machine:~/cmake-3.24.2-linux-x86_64/bin$ pwd /home/shuchengyang/cmake-3.24.2-linux-x86_64/bin shuchengyang@shuchengyang-virtual-machine:~/cmake-3.24.2-linux-x86_64/bin$
cd vi .bashrc
在最后添加环境变量如下:
export PATH=$PATH:/home/shuchengyang/cmake-3.24.2-linux-x86_64/bin
注意图中=两边不能有空格
生效配置
shuchengyang@shuchengyang-virtual-machine:~$ vi .bashrc shuchengyang@shuchengyang-virtual-machine:~$ source .bashrc shuchengyang@shuchengyang-virtual-machine:~$
在终端输入cmake提示如下表示cmake安装OK
还没有评论,来说两句吧...