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
1 2 3 |
$tar -zxvf cmake-3.7.2.tar.gz |
You should have now a folder like this
1 2 3 |
/opt/dev-tools-sources/cmake-3.7.2 |
Go to this folder
1 2 3 |
$cd /opt/dev-tools-sources/cmake-3.7.2 |
Install openssl to allow CMAKE have access to ssl protected websites if it needs to download extra files
1 2 3 |
$sudo apt install openssl libssl-dev |
Edit the bootstrap file and change the line:
1 2 3 |
cmake_options="-DCMAKE_BOOTSTRAP=1" |
To this
1 2 3 |
cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON" |
If you want cmake-gui, you will need qt4 libs an ncurses
1 2 3 |
$sudo apt install libqt4-dev qt4-dev-tools libncurses5-dev |
Run the configuration (you need to have gcc and g++ 4.7 or higher installed. I recommend 4.8.4 or higher actually!)
1 2 3 |
$./configure --qt-gui |
Make sure in the generated CMakeCache.txt, GUI is set to TRUE, open CMakeCache.txt with any editor and check the following line:
1 2 3 |
BUILD_QtDialog:BOOL=ON |
If it was OFF or 0, make it ON or 1
It is time to build executables and libraries from source:
1 2 3 |
$make -j2 |
Now, install:
1 2 3 |
$sudo make install |
Confirm you got gui version also
1 2 3 |
$cmake-gui |
ENJOY!
Thanks.
sudo make install
make: *** No rule to make target `install’. Stop.
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?
Many thanks for this useful post. For installing Cmake 3.10, can I follow a same steps?
Yes but I have not tested it myself…I think there should not be any differences
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
Thanks a lot, this worked pretty well.
tashakkore faravan.
dametun garm
In bootstrap file there is no content to modify