linux centos添加cmake
//
# 安装gcc编译器 sudo yum -y install gcc sudo yum -y install gcc-c++ yum install wget -y # centos 默认的cmake版本太低,所以得手动安装最新版 # 安装cmake之前,先考虑安装openssl,不然cmake可能安装不完整 rm -rf /usr/local/openssl mkdir /usr/local/openssl cd /usr/local/openssl wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz tar xvf openssl-1.1.1i.tar.gz cd openssl-1.1.1i ./config --prefix=/usr/local/openssl make make install rm -rf /usr/bin/OpenSSL ln -s /usr/local/openssl/bin/openssl /usr/bin/OpenSSL rm -rf /usr/bin/openssl ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1 ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1 yum install openssl-devel -y rm -rf /usr/local/cmake mkdir /usr/local/cmake cd /usr/local/cmake wget https://cmake.org/files/v3.19/cmake-3.19.1.tar.gz tar xvf cmake-3.19.1.tar.gz cd cmake-3.19.1 ./bootstrap --prefix=/usr/local/cmake gmake gmake install rm -rf /usr/bin/cmake ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake rm -rf /usr/bin/cpack ln -s /usr/local/cmake/bin/cpack /usr/bin/cpack rm -rf /usr/bin/ctest ln -s /usr/local/cmake/bin/ctest /usr/bin/ctest cmake --version
//