CMake is a powerful and easy to use build system for a wide variety of languages including:
- C / C++
- modern object-oriented Fortran 2008 / 2018
- Python
- Matlab / GNU Octave
It's important to use a recent CMake version to be effective and clean with CMake script. This can be done via the Python package described below, or from CMake >= 2.8.12 by:
cmake -P scripts/install_cmake.cmake
Ninja is recommended in general for use with CMake instead of Make:
cmake -P scripts/install_ninja.cmake
CMake plots dependency graphs for programs like:
cmake -B build --graphviz=gfx/block.dot
Then convert to PNG or SVG like:
python graph.py ~/myprog/gfx
Convert the resulting index.html with the SVGs to PDF like:
cmake -Dhtml=~/myprog/gfx/index.html -P html2pdf.cmake
CMake regular expressions have a distinct syntax tied to the origins of CMake syntax in the late 1990s. The CMake regex syntax is not the same as Python, Perl, etc. We give a few examples under regex.
To compile CMake from source, for example on BSD or ARM 32-bit using existing CMake:
cmake -S build_cmake -B build
Requirements:
- SSL library
- C++ compiler
- GNU Make or Ninja
- Download with git using FetchContent
- Download and extract ZIP
- measure system parameters with CMake. Note Cygwin reports really small RAM and zero virtual memory.