I followed the first answer to this question.
sudo apt-get install build-essential wget http://www.cmake.org/files/v3.2/cmake-3.5.0-rc2.tar.gz tar xf cmake-3.5.0-rc2.tar.gz cd cmake-3.5.0-rc2 ./configure make sudo apt-get install checkinstall sudo checkinstall
And this worked but ccmake was not installed. While googling I couldn't find how to add to the build/install cmake-curses-gui too.