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!

Saeid Yazdani

An Electronics Engineer with passion in Embedded Systems, Wireless Sensor Networks, Assembly, Desktop and Mobile Development, Web Development and generally anything that has to do with hardware and software of any kind!

10 Comments:

  1. Howard Johnson

    Thanks.

  2. 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.

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

  4. 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

  5. Stephane Schwarz

    Thanks a lot, this worked pretty well.

  6. tashakkore faravan.
    dametun garm

  7. In bootstrap file there is no content to modify

Leave a Reply to Howard Johnson Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.