Modern C++ project scaffold built using CMake and focused on a clean local development workflow.
This repository is currently an early-stage project structure. It already includes:
- CMake-based builds
- Debug and release presets
- Sanitizer presets
- Optional
vcpkgmanifest mode dependency management - Formatting with
clang-format - Static analysis with
clang-tidy - API documentation with Doxygen
- A basic application and test layout
The codebase is intentionally small right now and is expected to grow into a reusable project template over time.
This repository is currently in scaffold stage 😉 That means the build system, tooling, and repository structure are being present only.
Build and test the default local setup:
cmake --preset debug
cmake --build --preset debug
ctest --test-dir build/debug --output-on-failureIf you want dependency resolution through vcpkg:
export VCPKG_ROOT=/path/to/vcpkg
cmake --preset debug-vcpkg
cmake --build --preset debug-vcpkg
ctest --test-dir build/debug-vcpkg --output-on-failureFor a practical onboarding walkthrough, see GUIDE.MD.
Script alternatives:
./scripts/build.sh debug
./scripts/test.sh debug
./scripts/generate_docs.sh.
├── vcpkg.json
├── tests
│ └── tests.cpp
├── testapp
│ └── testapp.cpp
├── scripts
│ ├── tidy.sh
│ ├── tidy.ps1
│ ├── test.sh
│ ├── test.ps1
│ ├── install.sh
│ ├── install.ps1
│ ├── generate_docs.sh
│ ├── generate_docs.ps1
│ ├── format.sh
│ ├── format.ps1
│ ├── build.sh
│ └── build.ps1
├── lib
│ ├── lib.cpp
│ ├── interfaces
│ └── interface.hpp
├── generate_docs.sh
├── cmake
│ └── MyLibConfig.cmake.in
├── README.md
├── LICENSE.md
├── GUIDE.MD
├── Doxyfile.in
├── CONTRIBUTORS.md
├── CONTRIBUTING_GUIDE.md
├── CODE_CONVENTIONS.md
├── CMakePresets.json
└── CMakeLists.txt
(generated via 'tree --gitignore -C -vr -L 2')
Recommended local tools:
- CMake 3.25+
- Ninja
- A C++23-capable compiler (preferably Clang)
- Clang tools:
clang-formatclang-tidy
- Doxygen
Optional but useful:
ccachemoldgoldjemallocmimallocvcpkg
This scaffold supports two dependency paths:
- default configure flow with
FetchContentfallback for test dependencies vcpkgmanifest mode through dedicated presets
The repository includes a vcpkg.json manifest for project dependencies. To use the vcpkg presets, set VCPKG_ROOT in your environment so CMake can locate vcpkg.cmake.
Example:
export VCPKG_ROOT=/path/to/vcpkg
cmake --preset debug-vcpkg
cmake --build --preset debug-vcpkg
ctest --test-dir build/debug-vcpkg --output-on-failureIf you prefer not to use vcpkg, the default presets still work and CMake can fall back to fetching GoogleTest during configure.
Configure a debug build:
cmake --preset debugBuild the project:
cmake --build --preset debugRun tests:
ctest --test-dir build/debug --output-on-failureOr use the helper scripts:
./scripts/build.sh debug
./scripts/test.sh debugIncluded presets are:
debugdebug-gccdebug-clangdebug-msvcdebug-asandebug-ubsandebug-tsandebug-msandocsreleaserelease-msvcrelease-ltorelease-thinlto
Examples:
cmake --preset debug-asan
cmake --build --preset debug-asan
ctest --test-dir build/debug-asan --output-on-failurecmake --preset release
cmake --build --preset releasecmake --preset release-vcpkg
cmake --build --preset release-vcpkgFormat project sources in place:
cmake --build --preset debug --target formatCheck formatting without modifying files:
cmake --build --preset debug --target format-checkRun clang-tidy explicitly after configuring:
cmake --build --preset debug --target tidyEnable clang-tidy during compilation:
cmake --preset debug -DENABLE_CLANG_TIDY=ON
cmake --build --preset debugGenerate API documentation with Doxygen:
cmake --preset docs
cmake --build --preset docs --target docsOr use the helper script:
./generate_docs.shTo use the vcpkg docs preset:
./generate_docs.sh docs-vcpkgGenerated HTML output will be placed under:
docs/html/index.html
The Doxygen configuration targets lib/interface.hpp and lib/interfaces/ as the public API surface and also includes test sources as supplemental documentation for the scaffold.
PowerShell alternative:
./scripts/generate_docs.ps1GitHub Actions workflows are included for:
- GCC CI builds on Linux
- Clang CI builds on Linux
- MSVC CI builds on Windows
- Doxygen documentation generation and artifact upload
- GitHub Release asset publishing
- GHCR container publishing on release
- NuGet package publishing on release
compile_commands.jsonis enabled through CMake configuration.- Clang is recommended, though other compilers may work.
- Public headers are limited to
lib/interface.hppand headers underlib/interfaces/. - Optional performance-oriented tooling such as
ccacheand alternative linkers may be enabled automatically when available.
- Contribution process:
CONTRIBUTING_GUIDE.md - Coding standards:
CODE_CONVENTIONS.md - Contributors:
CONTRIBUTORS.md
This project is licensed under the MIT License.