下載源碼
wget https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2.tar.gz
解壓
tar -zxvf cmake-3.18.2.tar.gz
進(jìn)入cmark的源碼目錄
cd cmake-3.18.2
運(yùn)行bootstrap
這一步運(yùn)行時(shí)間較長。
./bootstrap
# 如果報(bào)錯(cuò) Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
# 解決方法,安裝c++編譯器
yum install -y gcc gcc-c++
運(yùn)行g(shù)make
gmake && gmake install
安裝完成
# 查看版本號(hào)
cmake --version