CMake 最新版本 3.10.2 需要 C++11 支持,而 gcc4.8 以下并未包含,,,3.9.6 版本并不需要 C++11,那就安装 CMake-3.9.6 吧:
# 当前版本为 cmake-2.8.12.2 cmake -version # 下载安装包 wget -c https://github.com/Kitware/CMake/releases/download/v3.9.6/cmake-3.9.6.tar.gz # 解压缩 tar -xzvf ./cmake-3.9.6.tar.gz cd ./cmake-3.9.6 # 安装编译工具 yum install -y gcc gcc-c++ make automake # 安装依赖包 yum install -y ncurses-devel libaio-devel openssl-devel # 编译安装 ./configure --prefix=/usr/local/cmake make && make install # 新建快捷方式 mv /usr/bin/ccmake /usr/bin/ccmake.old mv /usr/bin/cmake /usr/bin/cmake.old mv /usr/bin/cpack /usr/bin/cpack.old mv /usr/bin/ctest /usr/bin/ctest.old ln -s /usr/local/cmake/bin/ccmake /usr/bin/ccmake ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake ln -s /usr/local/cmake/bin/cpack /usr/bin/cpack ln -s /usr/local/cmake/bin/ctest /usr/bin/ctest