This Tutorial is presented to assist you to install/upgrade your existing Cmake installation to the latest release from Kitware. If you have an existing Cmake installation, you can simply use these simple steps to overwrite the installation directory from the binaries. ~Note~ The Ubuntu Pakages have Version 2.8 which is rather out of date to say the least.
Get the Newest Version:
Download the Distribution File directly from the KitwareWebsite, then extract the archive into your download folder.
From a Terminal, execute the following commands:
Preparation:username@hostname:~S sudo su
[sudo] password for [hostname]:
# apt-get update
# apt-get dist-upgrade
# cd /Downloads
/Downloads# wget https://cmake.org/files/v3.5/cmake-3.5.0-rc1.tar.gz
/Downloads# tar xzf cmake-3.5.0-rc1.tar.gz
/Downloads# cd cmake-3.5.0-rc1
/Downloads/cmake-3.5.0-rc1#
Rename the existing installation directory to the new version where, "x.x" is the existing installation directory and "3.5" will be the new name. We will also want to install a compiler (if you haven't already done so) and a few other tools.
From a Terminal, execute the following commands:
Additional Options:# mv /usr/share/cmake-x.x /usr/share/cmake-3.5
# apt-get install build-essential checkinstall
# apt-get install cvs subversion git-core mercurial
It is good practice to compile and install new software separate from your O/S, in case an installation fails because you are missing any dependencies. You should then build a common directory where you will be building these packages and prepare them for installation. You also want to make sure where you want to do this, is read/write/executable for the primary account user.
From a Terminal, execute the following commands:
Configuration:# sudo chown $USER /usr/local/src
# sudo chmod u+rwx /usr/local/src
In order to being configuration, we need to instruct the install script, what to do and where to do it. In this case, we are instructing the installtion script to initiate the configuration in the directory you just renamed.
From a Terminal, execute the following command:
*this takes a few minutes.*# ./configure --prefix=/usr/share/cmake-3.5
Compilation:
The previous command will bootstrap all the files within the cmake source directory and builds them so that they can be compiled.
From a Terminal, execute the following command:
Installation:# make
You are now ready to finish things off by installing.
From a Terminal, execute the following command:
Verification:# make install
After installation, without any errors, you can verify the installation.
From a Terminal, execute the following command:
This should display an output that resembles:# /usr/share/cmake-3.5/bin/cmake -version
**DONE!**cmake version 3.5.0-rc1
Cmake suite maintained and supported by Kitware (kitware.com/cmake)