A collection of commonly useful CMake functions for C and C++ projects
Linux/macOS tests:
Windows/Cygwin tests:
Table of contents:
NiceMake is a collection of CMake scripts for quickly setting up C and C++ projects, providing generic functionality such as (so far):
- platform and compiler-family detection
- Clang/GCC sanitizer setup
- third-party library handling
- a thin wrapper for
add_library
which adds compiler flags, include directories and third-party library dependencies - configure-time download of Google Test
NiceMake uses the convention-over-configuration approach, using default project layout conventions close to those used by the LLVM project. See the examples or the manual for further details.
NiceMake is free software distributed under the MIT license (X11 variant).
NiceMake aims to provide the functionality useful for most CMake-based C and
C++ projects with a relatively simple project structure. It is non-intrusive
in the sense that it can be easily used with plain CMake code (for example,
targets defined using the add_library
wrapper are regular CMake targets
with no new magic attached). NiceMake functions should be short, light on
dependencies and easy to understand. Thus, NiceMake is not a framework that
is difficult to escape.
See the NiceMake manual. There is also a Changelog.
NiceMake 0.3.0 requires CMake version 3.6.
- Copy NiceMake somewhere into your project, e.g. to the directory
cmake/nicemake
(such thatcmake/nicemake/NiceMake.cmake
exists). If you use git, you could simply dd the NiceMake repository as a submodule. - In your toplevel
CMakeLists.txt
, include NiceMake by inserting the lineinclude(cmake/nicemake/NiceMake.cmake)
- See the examples or the manual.
This project uses semantic versioning. In short: as soon as NiceMake has reached version 1.0.0,
- no breaking changes are introduced with minor-version or patchlevel updates, e.g. you can update the NiceMake from 1.2.2 to 1.3.1 without worrying about compatibility.
- breaking changes (e.g. increasing the required CMake version) may be introduced with major-version updates, e.g. with version 2.0.0.
Branch/tag | Type | Purpose |
---|---|---|
current |
branch | Development branch |
master |
branch | Stable branch |
rel-A.B.x-patches |
branch | Patch branch for release A.B.* |
rel-A.B.C |
tag | Tag pointing to release A.B.C |