{"id":48892713,"url":"https://github.com/megabyde/cpp-boilerplate","last_synced_at":"2026-04-16T09:13:54.804Z","repository":{"id":19214992,"uuid":"86518417","full_name":"megabyde/cpp-boilerplate","owner":"megabyde","description":"A modern C++23 project boilerplate using CMake and Conan 2","archived":false,"fork":false,"pushed_at":"2026-04-16T06:26:23.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-16T07:16:17.259Z","etag":null,"topics":["boilerplate","boost","cmake","conan","conan2","cpp","cpp23","googletest"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/megabyde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-03-28T23:47:54.000Z","updated_at":"2026-04-16T06:26:26.000Z","dependencies_parsed_at":"2022-09-20T09:25:37.965Z","dependency_job_id":null,"html_url":"https://github.com/megabyde/cpp-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/megabyde/cpp-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megabyde%2Fcpp-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megabyde%2Fcpp-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megabyde%2Fcpp-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megabyde%2Fcpp-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megabyde","download_url":"https://codeload.github.com/megabyde/cpp-boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megabyde%2Fcpp-boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31879134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","boost","cmake","conan","conan2","cpp","cpp23","googletest"],"created_at":"2026-04-16T09:13:54.249Z","updated_at":"2026-04-16T09:13:54.795Z","avatar_url":"https://github.com/megabyde.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Boilerplate\n\n[![Build](https://github.com/megabyde/cpp-boilerplate/actions/workflows/build.yml/badge.svg)](https://github.com/megabyde/cpp-boilerplate/actions/workflows/build.yml)\n[![C++23](https://img.shields.io/badge/C%2B%2B-23-blue.svg)](https://en.cppreference.com/w/cpp/23)\n[![CMake](https://img.shields.io/badge/CMake-3.28%2B-064F8C.svg)](https://cmake.org)\n[![Conan](https://img.shields.io/badge/Conan-2.x-6699CB.svg)](https://conan.io)\n[![License](https://img.shields.io/badge/license-Unlicense-green.svg)](LICENSE)\n\n## Overview\n\nA modern C++23 project template demonstrating end-to-end toolchain integration: Conan 2 dependency\nmanagement, CMake presets, multi-configuration builds, testing, sanitizers, coverage, CI, and IDE\nseteup.\n\nThis repository uses:\n\n- [CMake](https://cmake.org) presets and workflow presets as the public build interface\n- [Conan 2](https://conan.io) for dependency management\n- [Boost](https://www.boost.org) via Conan for portable utility libraries\n- [GoogleTest](https://github.com/google/googletest) via Conan\n\nThe sample code intentionally stays small, but it demonstrates a few C++23-friendly defaults:\n\n- `std::string_view` for lightweight input handling\n- `std::views::transform` in the sample utility pipeline without adding extra template machinery\n\nThe project keeps the public presets in the repository and lets Conan generate the toolchain and its\ninternal presets:\n\n- the project owns [`CMakePresets.json`](CMakePresets.json)\n- Conan generates `ConanPresets.json`\n- the public presets (`debug`, `release`, `asan`, `coverage`) inherit from Conan's internal\n  presets\n\nThe checked-in presets are the source of truth. The [`Makefile`](Makefile) is only a thin\nconvenience wrapper around `conan install` plus the public CMake presets and workflows.\n\nThis repository uses Conan's `CMakeConfigDeps` generator directly.\n\n## Prerequisites\n\n- CMake 3.28+\n- Conan 2\n- Ninja or GNU Make on Unix-like systems\n- A compiler and standard library with working C++23 support\n  - GCC 13+\n  - LLVM Clang 17+\n  - Apple Clang 17+ recommended\n\n\u003e [!IMPORTANT]\n\u003e If you are on a very new Apple Clang release, make sure your Conan installation and settings are\n\u003e up to date before running `conan profile detect`.\n\nConan chooses the CMake generator for you:\n\n- `Ninja` on Unix-like systems when it is available\n- `Unix Makefiles` on Unix-like systems when `ninja` is not installed\n\nThis boilerplate currently supports macOS and Linux.\n\n## Configure, build, and test\n\n### Quick start\n\n```console\ngit clone https://github.com/megabyde/cpp-boilerplate.git\ncd cpp-boilerplate\nmake conan-profile\nmake debug\n```\n\nOther local convenience targets:\n\n```console\nmake release\nmake asan\nmake coverage\n```\n\nThese targets do not define the build. They just run the matching Conan install command and then\ndelegate to the public CMake presets and workflows.\n\n### AddressSanitizer\n\n```console\nmake asan\n```\n\nThis uses a dedicated ASAN build tree under `build/DebugAsan`.\n\n\u003e [!NOTE]\n\u003e Conan owns the dependency graph, generator, toolchain, and ABI settings. If you switch the Conan\n\u003e configuration, rerun `make bootstrap` or the matching public `make` target and keep using the\n\u003e same public CMake preset names.\n\n### Tests\n\nTests are controlled by CMake's built-in `BUILD_TESTING` option from `include(CTest)`. This\nproject leaves it at the default `ON`, so the `release`, `asan`, and `coverage` workflows run the\ntest suite by default.\n\n## Public presets\n\n- Configure presets: `debug`, `release`, `asan`, `coverage`\n- Build presets: `debug`, `release`, `asan`, `coverage`\n- Test presets: `debug`, `release`, `asan`, `coverage`\n- Workflow presets: `debug`, `release`, `asan`, `coverage`\n\nThe Conan-generated `conan-*` presets are internal implementation details and are not the public\ninterface for developers or CI.\n\n## Dependency lock file\n\n`conan.lock` pins the exact dependency graph for reproducible builds. To update dependencies:\n\n1. Edit version pins in `conanfile.py`.\n2. Regenerate the lock file with `make lock`.\n3. Run the appropriate `make` target to verify.\n4. Commit both `conanfile.py` and `conan.lock`.\n\n## Formatting and linting\n\n```console\nmake format\nmake format-check\nmake lint\n```\n\n## Coverage\n\nGenerate an LCOV tracefile and HTML report with:\n\n```console\nmake coverage\n```\n\nThis writes:\n\n- `build/DebugCoverage/coverage.info`\n- `build/DebugCoverage/coverage-report/index.html`\n\n## Editor setup\n\n### VS Code\n\nVS Code with CMake Tools will discover the checked-in public presets automatically after Conan\ngenerates `ConanPresets.json`. Run `make bootstrap` first to generate both debug and release Conan\ntoolchains and presets.\n\nThen open the folder, accept the recommended extensions, and select the matching public preset.\nFor the checked-in launch configuration, choose the target you want in the CMake Tools sidebar and\nstart the platform-specific `Debug: CMake Target (...)` configuration. F5 will run the public\n`debug` workflow first and then launch the selected executable from `build/Debug`. On macOS, the\nrepository uses the CodeLLDB extension because the system `lldb` does not support the MI protocol\nused by `cppdbg`.\n\n### CLion\n\nCLion can use the same public presets. Run `make bootstrap` first, then in CLion:\n\n1. Open the project root\n2. Select the `debug`, `release`, `asan`, or `coverage` preset as the active CMake profile\n3. Reload CMake\n\n\u003e [!NOTE]\n\u003e No IDE-specific task files are required for the build. The presets are the source of truth.\n\u003e `debug`, `asan`, and `coverage` each use their own build tree, so switching between them does not\n\u003e require forcing a fresh reconfigure.\n\n## Layout\n\n- `include/`: public headers\n- `src/`: application sources\n- `tests/`: unit tests\n- `conanfile.py`: Conan dependency definition\n- `CMakePresets.json`: project-owned public presets and workflows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegabyde%2Fcpp-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegabyde%2Fcpp-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegabyde%2Fcpp-boilerplate/lists"}