Rate This Document
Findability
Accuracy
Completeness
Readability

Installing CMake from Source Code

The CMake version must be 3.5.1 or later. CMake 3.10.0 is recommended.

  1. Go to the /home directory.
    1
    cd /home
    
  2. Obtain the source package.
    1
    wget https://github.com/Kitware/CMake/releases/download/v3.10.0/cmake-3.10.0.tar.gz
    
  3. Decompress the source package.
    1
    tar -zxvf cmake-3.10.0.tar.gz
    
  4. Go to the source package directory.
    1
    cd cmake-3.10.0
    
  5. Configure the compilation.
    1
    ./bootstrap --prefix=/usr/local/cmake
    

  6. Compile CMake.
    1
    make -j
    

  7. Install CMake.
    1
    make install
    

  8. Set environment variables.
    export PATH=$PATH:/usr/local/cmake/bin/
  9. View the version information to check whether the installation is successful.
    1
    cmake  --version
    

    If the version is not 3.10.0, see cmake.