cmake的安装 升级
今天想用一下libuv 这个库,下载下来变异的时候发现需要cmake
bash: cmake: command not found
于是按照平常的直接yum安装。
yum install cmake 安装成功。
再去编译libuv的东西:
CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
CMake 3.4 or higher is required. You are running version 2.8.12.2
– Configuring incomplete, errors occurred!
[root@localhost cmake]# cmake --version
cmake version 2.8.12.2
糟糕,yum 安装的默认版本是2.8,而项目需要3.4以上。
所以手动下载升级吧:
下载地址:https://cmake.org/download/
要下源码:cmake-3.16.0-rc4.tar.gz
解压:tar -zxvf cmake-3.16.0-rc4.tar.gz
然后进入解压的目录进行配置
./configure
编译 安装:
make && make install
ok 确认一下 版本
cmake --version
ok nice!
很不幸再用cmake 去编译别的项目的时候
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.
网上查了一下 要执行一个命令就可以啦
hash -r 具体我也不知道是干嘛的,想知道就问下度娘吧!