Download cmake from https://cmake.org/download/
$ wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
Build from source and install
$ tar -xvzf cmake-3.12.3.tar.gz
$ cd cmake-3.12.3
$ ./configure --prefix=/usr
$ make -j$(nproc)
$ make install
Validate installation
$ cmake --version
cmake version 3.12.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).