Installing CMake 3.5.2

  1. Run the wget command to download the source code package of CMake to any directory on the server:
    wget https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz --no-check-certificate 
  2. Run the following command to go to the download directory and decompress the source code package:
    tar -zxvf cmake-3.5.2.tar.gz 
  3. Go to the decompressed folder and run the following configuration, compilation, and installation commands:
    cd cmake-3.5.2
    ./bootstrap --prefix=/usr
    make
    sudo make install
  4. After the installation is complete, run the cmake --version command again to check the version number.