First of all download the source from here: https://cmake.org/download/
More specificly for Ubuntu 14.04 or higher, 64 bit: https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
Download it to the following directory (or any directory you like!) /opt/dev-tools-sources
Unzip it there, using gui or command line $tar -zxvf cmake-3.5.2.tar.gz 1 $tar -zxvf cmake-3.5.2.tar.gz
You should have now a folder like this /opt/dev-tools-sources/cmake-3.5.2 1
/opt/dev-tools-sources/cmake-3.5.2
Go to this folder $cd /opt/dev-tools-sources/cmake-3.5.2 1 $cd /opt/dev-tools-sources/cmake-3.5.2
Install openssl to allow CMAKE have access to ssl protected websites if it needs to download extra files $sudo apt install openssl libssl-dev 1 $sudo apt install openssl libssl-dev
Edit the bootstrap file and change the line: cmake_options=”-DCMAKE_BOOTSTRAP=1″ 1
cmake_options=”-DCMAKE_BOOTSTRAP=1″
To this cmake_options=”-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON” 1
cmake_options=”-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON”
If you want cmake-gui, you will need qt4 libs an ncurses $sudo apt install libqt4-dev qt4-dev-tools libncurses5-dev 1 $sudo apt install libqt4-dev qt4-dev-tools libncurses5-dev
Run the configuration (you need to have gcc and g++ 4.7 or higher installed. I recommend 4.8.4 or higher actually!) $./configure –qt-gui 1 $./configure –qt-gui
Make sure in the generated CMakeCache.txt, GUI is set to TRUE, open CMakeCache.txt with any editor and check the following line: BUILD_QtDialog:BOOL=ON 1 BUILD_QtDialog:BOOL=ON
If it was OFF or 0, make it ON or 1
It is time to build executables and libraries from source: $make -j2 1 $make -j2
Now, install: $sudo make install 1 $sudo make install
Confirm you got gui version also $cmake-gui 1 $cmake-gui
ENJOY!