https://github.com/scivision/cmakeutils
Helpful scripts and modules for CMake, especially for scientific computing, HPC, and Fortran
https://github.com/scivision/cmakeutils
cmake cmake-modules gnu-octave
Last synced: about 2 months ago
JSON representation
Helpful scripts and modules for CMake, especially for scientific computing, HPC, and Fortran
- Host: GitHub
- URL: https://github.com/scivision/cmakeutils
- Owner: scivision
- License: mit
- Created: 2018-10-18T01:22:22.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-02-27T18:05:07.000Z (3 months ago)
- Last Synced: 2025-03-12T16:51:52.910Z (2 months ago)
- Topics: cmake, cmake-modules, gnu-octave
- Language: CMake
- Homepage:
- Size: 499 KB
- Stars: 23
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# CMake Utils
[](https://doi.org/10.5281/zenodo.1488084)
[](https://github.com/scivision/cmakeutils/actions/workflows/ci.yml)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](https://github.com/scivision/matlab-cmake-mex)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:```sh
cmake -P scripts/install_cmake.cmake
```Ninja is recommended in general for use with CMake instead of Make:
```sh
cmake -P scripts/install_ninja.cmake
```## convert CMake hierarchy .dot to SVG or PNG
CMake plots
[dependency graphs](https://www.scivision.dev/cmake-dependency-graph)
for programs like:```sh
cmake -B build --graphviz=gfx/block.dot
```Then convert to PNG or SVG like:
```sh
python graph.py ~/myprog/gfx
```Convert the resulting index.html with the SVGs to PDF like:
```sh
cmake -Dhtml=~/myprog/gfx/index.html -P html2pdf.cmake
```## CMake regular expressions
CMake [regular expressions](https://cmake.org/cmake/help/latest/command/string.html#regex-specification)
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](./regex).## Build CMake
To compile CMake from source, for example on BSD or ARM 32-bit using existing CMake:
```sh
cmake -S build_cmake -B build
```Requirements:
* SSL library
* C++ compiler
* GNU Make or Ninja## Examples
* Download with [git](./fetchgit) using [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
* Download and extract [ZIP](./zip)
* measure [system](./system) parameters with CMake. Note Cygwin reports really small RAM and zero virtual memory.