Production-ready C++ template with Android NDK, cross-compilation to Windows, Docker, CPack, and one-command CI pipelines. Targets C++23/26. Ninja Multi-Config, CPM, 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-fullMost CMake starters stop at "it builds on my machine". This template goes further with first-class cross-compilation and packaging.
- Android NDK out of the box — 4 presets (arm64, arm32, x64, x86) with API 24.
- Linux → Windows cross-compile — 3 llvm-mingw presets (x86_64, i686, aarch64).
- Reproducible builds — Docker images for CI and local development.
- One-command pipelines —
cmake --workflowhandles configure → build → test → package. - Modern standards — C++23/26 with clang-tidy, clang-format, IWYU-ready structure.
| Feature | cmake_template | cpp-best-practices | kigster | district10 | pamplejuce |
|---|---|---|---|---|---|
| Pitch | Generic C++ starter with cross-compile | Opinionated best-practice starter | Minimal C/C++ starter | Qt / Boost / OpenCV examples | JUCE audio plugins |
| C++ Standard | 23 / 26 | 17 / 20 | unspecified | 11 | unspecified |
| CMake Presets | 10+ with workflows | — | basic | — | JUCE-oriented |
| Android NDK | ✅ | ❌ | ❌ | ❌ | ❌ |
| Android instrumentation (tests) | ✅ | ❌ | ❌ | ❌ | ❌ |
| Linux → Windows cross | ✅ llvm-mingw | ❌ | ❌ | ❌ | ❌ |
| WebAssembly | ❌ planned (#2) | ✅ + GitHub Pages deploy | ❌ | ❌ | ❌ |
| Docker / CI-ready | ✅ Dockerfile + GitHub Actions | ✅ Docker + Actions | ❌ | ❌ | ✅ GitHub Actions |
| CPack packaging | ✅ tar.gz / zip / tar.xz | ❌ | ❌ | ❌ | ❌ |
| CTest test runner | ✅ | ✅ | ❌ | ❌ | ❌ |
| Dependency manager | CPM + prebuilt/air-gapped (#8) | CPM | — | — | — |
| vcpkg compatibility | ❌ planned (#3) | ❌ | ❌ | ❌ | ❌ |
| Sanitizers (ASan/UBSan) | ❌ planned (#9) | ✅ | ❌ | ❌ | ❌ |
| Fuzz testing | ❌ | ✅ libFuzzer | ❌ | ❌ | ❌ |
| Codecov / CodeQL | ❌ planned (#10) | ✅ | ❌ | ❌ | ❌ |
| Steam Runtime / Steam Deck | ❌ planned (#11) | ❌ | ❌ | ❌ | ❌ |
| Qt / OpenGL | ❌ | ❌ | ❌ | ✅ | ❌ |
| Audio / JUCE | ❌ | ❌ | ❌ | ❌ | ✅ |
| C++20 modules | ❌ planned (#5) | ❌ | ❌ | ❌ | ❌ |
Honest notes: this template is intentionally generic — it does not include Qt, OpenGL, audio scaffolding, or fuzz testing. Those are well covered by specialized starters above. We focus on cross-platform build engineering and packaging.
cmake 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.
Need help with CMake architecture, cross-compilation pipelines, CI/CD for C++, or packaging with CPack? I help teams reduce build friction and ship faster.
- 🌐 e-gleba.github.io — contacts, portfolio, and blog
- 📧 i@egleba.ru — direct inquiries (fastest response)
- 💼 Open for freelance and contract work (up to $150/hr depending on scope)
- 🛠️ Services: CMake audits, toolchain setup, Docker/CI optimization, custom presets, onboarding workshops
For inquiries, reach out via email or through the website above, or open a Discussion.
Curated C++ ecosystem links — standards, tooling, and community references — are maintained in docs/references.md.
