Chapter 1

Installing CMake

CMake is supported for almost all the platforms. On many system is posible to find that the software is already installed or is available in the standard package manager used in the operating system. For other platforms the precompiled version can be found for free in the main page of the project Cmake.

Linux, MacOS, UNIX

If you are using an operating system derived from Unix or a Linux distribution is probable that CMake is already installed in your computer. In case is not installed, follow the next instructions depending on the platform

  1. Debian:
$ apt-get update
$ apt-get install cmake
  1. Fedora:
$ yum update
$ yum install cmake
  1. Arch:

    $ pacman -S cmake
    
  2. From Source Code: It's possible that the binary downloaded using the package manager is outdated and you need a more updated one or that cmake is not in the database for that operating system.

For those cases it's possible to install cmake from the source code.

First fetch the binary from the platform

$ wget "https://cmake.org/files/LatestRelease/cmake-<version>.tar.gz"

Extract the source to the current directory

$ tar xzf cmake-<version>.tar.gz
$ cd cmake-<version>

Create the configuration files and instruct the install scripts to build cmake inside /opt/cmake ( You can choose other path to build your cmake binary )

$ ./configure --prefix=/opt/cmake

Compile the source, -j allows the creation of multiple threads of compilation. Be careful how many threads you create

$ make -j3

Intall the binary in the final directory

$ make install

And the cmake binary should be ready to use in /opt/cmake/bin/cmake. In order to call the tool in any part of the operating system then you should either create a soft link o add /opt/cmake/bin/cmake to the bin path.

Or also can be downloaded from this link

results matching ""

    No results matching ""