2.1. CMake Installation

That’s it, ground.
I wonder if it will be friends with me?
Hello, ground!

Obviously to use some tool you need to install it first. CMake can be installed using default system package manager or by getting binaries from Download page.

2.1.1. Ubuntu

CMake can be installed by apt-get:

> sudo apt-get -y install cmake
> which cmake
/usr/bin/cmake
> cmake --version
cmake version 2.8.12.2

Installing CMake GUI is similar:

> sudo apt-get -y install cmake-qt-gui
> which cmake-gui
/usr/bin/cmake-gui
> cmake-gui --version
cmake version 2.8.12.2

Binaries can be downloaded and unpacked manually to any location:

> wget https://cmake.org/files/v3.4/cmake-3.4.1-Linux-x86_64.tar.gz
> tar xf cmake-3.4.1-Linux-x86_64.tar.gz
> export PATH="`pwd`/cmake-3.4.1-Linux-x86_64/bin:$PATH" # save it in .bashrc if needed
> which cmake
/.../cmake-3.4.1-Linux-x86_64/bin/cmake
> which cmake-gui
/.../cmake-3.4.1-Linux-x86_64/bin/cmake-gui

Version:

> cmake --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
> cmake-gui --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake)

2.1.2. OS X

CMake can be installed on Mac using brew:

> brew install cmake
> which cmake
/usr/local/bin/cmake
> cmake --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake)

Binaries can be downloaded and unpacked manually to any location:

> wget https://cmake.org/files/v3.4/cmake-3.4.1-Darwin-x86_64.tar.gz
> tar xf cmake-3.4.1-Darwin-x86_64.tar.gz
> export PATH="`pwd`/cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin:$PATH"
> which cmake
/.../cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin/cmake
> which cmake-gui
/.../cmake-3.4.1-Darwin-x86_64/CMake.app/Contents/bin/cmake-gui

Version:

> cmake --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
> cmake-gui --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

2.1.2.1. DMG installer

Download cmake-*.dmg installer from Download page and run it.

Click Agree:

../_images/01-agree.png

Drag CMake.app to Applications folder (or any other location):

../_images/02-drag.png

Start Launchpad:

../_images/03-launchpad.png

Find CMake and launch it:

../_images/04-search-cmake.png

2.1.3. Windows

Download cmake-*.exe installer from Download page and run it.

Click Next:

../_images/installer-01.png

Click I agree:

../_images/installer-02.png

Check one of the Add CMake to the system PATH ... if you want to have CMake in PATH. Check Create CMake Desktop Icon to create icon on desktop:

../_images/installer-03.png

Choose installation path. Add suffix with version in case you want to have several versions installed simultaneously:

../_images/installer-04.png

Shortcut in Start Menu folder:

../_images/installer-05.png

Installing...

../_images/installer-06.png

Click Finish:

../_images/installer-07.png

Desktop icon created:

../_images/desktop-icon.png

If you set Add CMake to the system PATH ... checkbox then CMake can be accessed via terminal (otherwise you need to add ...\bin to PATH environment variable):

> where cmake
C:\soft\develop\cmake\3.4.1\bin\cmake.exe

> where cmake-gui
C:\soft\develop\cmake\3.4.1\bin\cmake-gui.exe

> cmake --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).