Modern C++ project template. Ninja Multi-Config, CPM, CPack, cross-compilation, code quality tooling — zero friction from clone to package.
cmake --preset=gcc
cmake --build --preset=gcc-release
ctest --preset=gcc-releaseFull pipeline (configure → build → test → package):
cmake --workflow --preset=gcc-fullcmake 3.31+
ninja 1.11+
C++23-capable compiler (clang 16+, gcc 13+, msvc 19.35+)
brew install cmake llvm ninja doxygensudo dnf install cmake gcc-c++ ninja-build doxygen llvm clang-tools-extrasudo apt install cmake g++ ninja-build doxygen llvm clang-toolschoco install cmake llvm ninja doxygen visualstudio2022buildtoolsAll presets use Ninja Multi-Config (except msvc → Visual Studio 17 2022).
| Preset | Compiler | Platform | Notes |
|---|---|---|---|
gcc |
GCC/G++ | Native | — |
clang |
Clang/Clang++ | Native | — |
msvc |
MSVC (VS 2022) | Windows | x64 arch, x64 host toolset |
android-arm64 |
NDK | Android | arm64-v8a, API 24 |
android-arm32 |
NDK | Android | armeabi-v7a, API 24 |
android-x64 |
NDK | Android | x86_64 (emulator) |
android-x86 |
NDK | Android | x86 (emulator) |
llvm-mingw-x86_64 |
LLVM-MinGW | Linux → Windows | 64-bit cross-compilation |
llvm-mingw-i686 |
LLVM-MinGW | Linux → Windows | 32-bit cross-compilation |
llvm-mingw-aarch64 |
LLVM-MinGW | Linux → Windows | ARM64 cross-compilation |
cmake --build --preset=<name>-release
cmake --build --preset=<name>-debugAvailable: gcc-release, gcc-debug, clang-release, clang-debug, msvc-release, msvc-debug, android-arm64, android-arm32, android-x64, android-x86, llvm-mingw-x86_64, llvm-mingw-i686, llvm-mingw-aarch64.
ctest --preset=<name>-releaseAvailable: gcc-release, gcc-debug, clang-release, clang-debug, msvc-release, msvc-debug. Tests are disabled for cross-compiled targets.
cpack --preset=<name>-package| Preset | Format |
|---|---|
gcc-package |
.tar.gz |
clang-package |
.tar.gz |
msvc-package |
.zip |
llvm-mingw-*-package |
.tar.xz |
Full pipelines (configure → build → test → package) in a single command:
cmake --workflow --preset=gcc-full
cmake --workflow --preset=clang-full
cmake --workflow --preset=msvc-full
cmake --workflow --preset=android-arm64-full # configure + build only
cmake --workflow --preset=llvm-mingw-x86_64-full # configure + build + package (no test).
├── CMakeLists.txt
├── CMakePresets.json
├── cmake/ # find_package modules (warnings, cpm, code quality)
├── src/ # application sources
├── tests/ # doctest + CTest
├── tools/ # helper scripts
├── docker/ # Dockerfiles for reproducible builds
├── android-project/ # Android project scaffolding
├── .clang-format # clang-format config
├── .clang-tidy # clang-tidy config
├── .cmake-format.yaml # cmake-format config
├── .editorconfig # editor defaults
├── .pre-commit-config.yaml # pre-commit hooks
└── license # MIT
Format sources and CMake files:
cmake --build build/gcc --target formatStatic analysis:
cmake --build build/gcc --target tidyLint:
cmake --build build/gcc --target cpplintPre-commit hooks enforce formatting on every commit. Install once:
pre-commit installcmake --build build/gcc --target doxygenOutput: build/gcc/docs/doxygen/html.
docker build -t cxx-skeleton -f docker/fedora.Dockerfile .
docker run --rm -v "$(pwd):/src" cxx-skeleton cmake --workflow --preset=gcc-fullSet ANDROID_NDK_HOME and run:
export ANDROID_NDK_HOME=/path/to/ndk
cmake --workflow --preset=android-arm64-fullRequires llvm-mingw on PATH:
cmake --workflow --preset=llvm-mingw-x86_64-fullManaged via CPM. Add packages in CMakeLists.txt:
CPMAddPackage("gh:fmtlib/fmt#11.1.4")CPM downloads are verbose (FETCHCONTENT_QUIET=OFF) for CI visibility.
The project generates compile_commands.json and is compatible with CLion, Visual Studio, QtCreator, KDevelop, and any LSP-based editor.
- C++ Core Guidelines — Stroustrup & Sutter
- cppreference.com — Language reference
- C++ Draft Standard — Latest working draft
- WG21 Link — Proposal shortener
- C++ Evolution — Feature tracker
- Compiler Explorer — Live assembly
- C++ Insights — Compiler transformations
- Quick Bench — Micro-benchmarks
- IWYU — Header analysis
- Perfetto UI — Build profiling
- Performance-Aware Programming — Casey Muratori
- Agner Fog — Optimization manuals
- uops.info — Instruction latencies
- C++ Weekly — Jason Turner
- C++ Stories — Bartek Filipek
- CppCon — Conference talks
- Handmade Hero — Casey Muratori
