Linux系统 cmake2.8升级到cmake-3.9.2版本

1、查看当前版本

cmake --version

2、下载获得cmake-3.9.2源码 

wget https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz

3、解压、安装新版本

tar -xvf cmake-3.9.2.tar.gz

cd cmake-3.9.2

./configure

sudo make && make install

【注】安装完后,执行cmake --version会报如下错误

CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/Applications/CMake 2.8-11.app/Contents/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.

【解决方法】

先执行:hash -r

然后再执行:cmake --version

完美解决
--------------------- 
作者:suibianshen2012 
来源:CSDN 
原文:https://blog.csdn.net/suibianshen2012/article/details/81504577 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/yuchunhai321/article/details/87430034