I'll be honest: I haven't used Make or CMake in ages. But sometimes you need to install some system tool that comes with a make file, and you discover that you don't have CMake installed or your version is too old and doesn't work with said make file.
So this is what I did to install it (in case I have to do it again):
- Uninstall your current version:
sudo apt-get purge cmake
- Go to official CMake webpage then download and extract the latest version.
mkdir ~/temp cd ~/temp wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz tar xzvf cmake-3.7.2.tar.gz cd cmake-3.7.2/
- Install it by running:
./bootstrap make -j4 sudo make install
- Test your new
- Results of
cmake version 3.7.2 CMake suite maintained and supported by Kitware (kitware.com/cmake).
Note In 3.7.X the X represent a number that may change if the app is updated. According to the official webpage the Latest Release at the moment of writing this is 3.7.2.
The make install command need root privileges. The
cmake --version command only works after you open a new terminal because cmake is installed under
/usr/local/bin/ by default, not
I also had to update my gcc. Since I use Ubuntu, this is the ppa:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-6.3