This repository defines a set of CMake helper macros used across the OpenSCMS stack to ensure consistent interpretation of options, and setup of tools such as the compiler, valgrind, and cppcheck.
Essentially it removes a lot of boiler plate code from the CMakeLists.txt files found in the C-based projects of the stack.
It is brought into context via the CMake FetchContent commands, rather than using yet another submodule.
We assume a debian-based development environment, ideally Ubuntu 24.04 or newer.
This library has no external dependencies. However, you will need a set of tools
sudo apt-get -qy install \
build-essential \
clang-format-18 \
cmake \
cppcheck \
curl \
git \
gzip \
valgrind \
wgetSimply clone the repository as follows (assuming you have SSH access set up).
git clone git@github.com:OpenSCMS/oscms-cmake-helpers.gitObviously, replace the URL with your own if you are cloning a fork or using HTTPS.
All C code is built using CMake and the CMake scripts will enforce out-of-source builds.
After cloning, create a build directory. We usually use BUILD directly in the repository root (it's included in the .gitignore), but feel free to put it anywhere convenient.
Change to your build directory and configure and build as follows
cmake .. # Or the path to your repository root
makeNote that this project defines no targets, but the above will at least check your changes for any syntax errors.
Contributions are welcome. Please see the CONTRIBUTING file for details, including the Code of Conduct and C Style Guide.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.