"); //-->
1、下载需要的版本
1 | https://cmake.org/download/ |
2、解压、编译并安装到制定目录,修改环境变量
1 2 3 4 5 6 7 8 9 10 11 12 13 | tar -zxvf cmake-3.20.0-rc1.tar.gz cd cmake-3.20.0-rc1 ./bootstrap --prefix=/opt/cmake-install make make install sudo gedit ~/.bashrc #把下面两个命令加入~/.bashrc中 export PATH=/opt/cmake-install/bin:$PATH export CMAKE_PREFIX_PATH=/opt/cmake-install:$CMAKE_PREFIX_PATH #保存一下并运行 source ~/.bashrc |
我目前使用的是:
vim ~/.bashrc
export PATH=/opt/cmake-3.17.0-Linux-x86_64/bin:$PATH export CMAKE_PREFIX_PATH=/opt/cmake-3.17.0-Linux-x86_64:$CMAKE_PREFIX_PATH
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。