Installing CMake from Source Code
The CMake version must be 3.5.1 or later. CMake 3.10.0 is recommended.
- Go to the /home directory.
cd /home
- Obtain the source package.
wget https://github.com/Kitware/CMake/releases/download/v3.10.0/cmake-3.10.0.tar.gz
- Decompress the source package.
tar -zxvf cmake-3.10.0.tar.gz
- Go to the source package directory.
cd cmake-3.10.0
- Configure the compilation.
./bootstrap --prefix=/usr/local/cmake

- Compile CMake.
make -j

- Install CMake.
make install

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

If the version is not 3.10.0, see cmake.
Parent topic: Configuring the Installation Environment