CMake

Before starting: Make sure you have the necessary folders and permissions — get more information.

Links: Homepage | Downloads
Dependencies: None
Version: 3.8.2

CMake is a cross-platform, open-source build system designed to build, test and package software. CMake is used to control the software compilation process using platform and compiler independent configuration files.

Get the Code

Switch to /usr/local/src and download the source package.

cd /usr/local/src
curl --remote-name https://cmake.org/files/v3.8/cmake-VERSION.tar.gz

Extract the archive and move into the folder.

tar -xzvf cmake-VERSION.tar.gz
cd cmake-VERSION

Compile and Install

Configure, compile and install into /usr/local/mac-dev-env/cmake-VERSION.

./bootstrap --prefix=/usr/local/mac-dev-env/cmake-VERSION
make
make install

Create a symbolic link to /usr/local/cmake.

ln -s mac-dev-env/cmake-VERSION /usr/local/cmake

Shell

Execute the following lines to update your Bash startup script.

echo 'export PATH=/usr/local/cmake/bin:$PATH' >> ~/.bash_profile

Load the new shell configurations.

source ~/.bash_profile

Verify the Installation

Verify that you have successfully installed CMake.

cmake --version