A modern, cross-platform C++ project boilerplate with CMake setup.
- Cross-Platform: Preconfigured presets for Windows (MSVC/Clang), Unix-like (GCC/Clang), and WebAssembly (Emscripten)
- Modern CMake: Targets-based structure with
CMakePresets.jsonconfiguration and mandatory preset system - Modular Architecture: Clean separation with
register_executable(),register_library(),register_test(),register_emscripten(), andregister_project() - Built-in Quality Tools:
.clang-format,.clang-tidy, sanitizers, and hardening options - Project Infrastructure: Automatic version/config generation, CPM/XRepo package management
- Sample Projects: 6 ready-to-use examples covering basic usage, libraries, packages, testing, and WebAssembly
- Environment Integration:
.envfile support for secrets and configuration management
- CMake ≥ 3.21
- C++ Compiler (MSVC, GCC, Clang, or Emscripten)
- Ninja (recommended) or Visual Studio 2022 (Windows)
Native Development:
# Clone and navigate
git clone https://github.com/<user>/<your_new_repo>.git
cd <your_new_repo>
# Build with mandatory preset specification
./scripts/build.ps1 -Preset windows-msvc-release
./scripts/test.ps1 -Preset test-windows-msvc-release -VerboseOutput
./scripts/install.ps1 -Preset windows-msvc-releaseManual CMake:
# Direct CMake usage
cmake -S ./project -B "build" --preset unixlike-gcc-release
cmake --build "build" --target install
ctest --test-dir "build"- Windows:
windows-msvc-debug/release,windows-clang-debug/release - Unix-like:
unixlike-gcc-debug/release,unixlike-clang-debug/release - WebAssembly:
emscripten-debug/release
- Preset-Based: All scripts require mandatory
-Presetparameter for consistent builds - Simple Mode:
DEV_MODE=ON(dev tools),RELEASE_MODE=ON(optimizations) - Advanced: Fine-grained control over sanitizers, static analysis, warnings
- Environment: Use
.envfiles for secrets and configuration values
Edit ProjectMetadata.cmake to set project name, version, and description.
Contributions welcome! Please:
- Follow existing code style (enforced by .clang-format)
- Test changes with multiple presets and platforms
- Update documentation accordingly
MIT License - See LICENSE file for details.