Build and install CMAKE 3.7.2 on Ubuntu

This guide should work for any recent version of CMAKE up to 3.8.X.

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.7/cmake-3.7.2.tar.gz

Download it to the following directory (or any directory you like! but make sure to use that directory!)
/opt/dev-tools-sources

Unzip it there, using gui or command line

You should have now a folder like this

Go to this folder

Install openssl to allow CMAKE have access to ssl protected websites if it needs to download extra files

Edit the bootstrap file and change the line:

To this

If you want cmake-gui, you will need qt4 libs an ncurses

Run the configuration (you need to have gcc and g++ 4.7 or higher installed. I recommend 4.8.4 or higher actually!)

Make sure in the generated CMakeCache.txt, GUI is set to TRUE, open CMakeCache.txt with any editor and check the following line:

If it was OFF or 0, make it ON or 1

It is time to build executables and libraries from source:

Now, install:

Confirm you got gui version also

ENJOY!

Avatar photo
Saeid Yazdani

Embedded Systems Engineer, PhD, and technical author with professional experience in embedded firmware, electronics design, microcontrollers, test and measurement systems, and modern C++ development. Currently working as a Software Engineer at Infineon Technologies and previously at Rohde & Schwarz. Founder of Embedonix, where I share practical engineering knowledge and project experiences.

Articles: 33

9 Comments

  1. sudo make install
    make: stat: GNUmakefile: Permission denied
    make: stat: makefile: Permission denied
    make: stat: Makefile: Permission denied
    make: stat: install: Permission denied
    make: *** No rule to make target `install’. Stop.

    • Are you sure you are in the correct directory? do you have read/write permissions for the directory you are executing the make commands there?

  2. Many thanks for this useful post. For installing Cmake 3.10, can I follow a same steps?

  3. Hm, do I have to download the file in /opt/dev-tools-sources ? I don’t even have that directory in /opt/ . Should I create it? cmake 3.2 is what’s in Mint 17.3, which is an LTS version, at least for one more year and I need one higher than that to compile something I need. 17.3 works on 14.04.4 if I understand well, trusty-tahr or such, is that a problem? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *