cmake


Introduction:

CMAKE
is an open-source cross-platform family of tools which can build,
test, and package software. CMake is used to control the software
compilation process using simple platform and compiler independent
configuration files. It generates native makefiles and workspaces that
can be used in a given compiler environment.

CMAKE uses a text file named CMakeLists.txt, in the home directory
of the software package, to specify the actions that are necessary to set
up the software. Each subdirectory of the home
directory should also have a CMakeLists.txt file. The
user begins the build process by moving to the home directory and
typing

      cmake .
    

CMAKE will carry out a configuration process, typically involving
many messages to the screen, after which a traditional Makefile
will be created in the home directory. The software process is
then completed by typing

      make
    

Before the creation of CMAKE, an author distributing software
would often have to include not one, but many variations of
a suitable makefile, and these would only cover the most common
choices of operating system, machine precision, and so on. CMAKE
is much more flexible in allowing a single description of the
desired result, which is then implemented after determining the
local computing environment.

Web Site:


https://cmake.org

Reference:

Usage:

On any ARC cluster, check the installation details
by typing "module spider cmake".

CMAKE requires that the appropriate modules be loaded before it can be run.
One version of the appropriate commands for use on NewRiver is:

module purge
module load cmake/3.7.2
    

Examples:

The following batch file illustrates how CMAKE can be invoked in
a directory containing a CMakeLists.txt file, to create a Makefile,
which can then be invoked by the make command, to set up
a software package.

#! /bin/bash
#
#PBS -l walltime=5:00
#PBS -l nodes=1:ppn=1
#PBS -q open_q
#PBS -W group_list=newriver
#PBS -j oe

cd $PBS_O_WORKDIR

module purge
module load cmake/3.7.2
#
ls
#
cmake .
#
ls
#
make
#
ls

A complete set of files to carry out a similar process are available in
cmake_example.tar