{"id":28320535,"url":"https://github.com/cpp20120/cmake_boilerplate","last_synced_at":"2026-01-27T00:12:48.150Z","repository":{"id":289626893,"uuid":"971871635","full_name":"cpp20120/cmake_boilerplate","owner":"cpp20120","description":"Cmake Projects Boilerplate with batteries inlcuded","archived":false,"fork":false,"pushed_at":"2025-07-08T11:10:30.000Z","size":299,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T12:26:11.632Z","etag":null,"topics":["boilerplate","build","cmake","docs","doxygen","format","graphics","ninja","shaders","static-analysis"],"latest_commit_sha":null,"homepage":"https://deepwiki.com/cpp20120/cmake_boilerplate/1-overview","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cpp20120.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}},"created_at":"2025-04-24T07:23:45.000Z","updated_at":"2025-07-08T11:10:33.000Z","dependencies_parsed_at":"2025-07-19T08:31:11.553Z","dependency_job_id":null,"html_url":"https://github.com/cpp20120/cmake_boilerplate","commit_stats":null,"previous_names":["cpp20120/cmake_boilerplate"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/cpp20120/cmake_boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpp20120%2Fcmake_boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpp20120%2Fcmake_boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpp20120%2Fcmake_boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpp20120%2Fcmake_boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cpp20120","download_url":"https://codeload.github.com/cpp20120/cmake_boilerplate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpp20120%2Fcmake_boilerplate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28792646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: 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","build","cmake","docs","doxygen","format","graphics","ninja","shaders","static-analysis"],"created_at":"2025-05-25T11:11:40.218Z","updated_at":"2026-01-27T00:12:48.143Z","avatar_url":"https://github.com/cpp20120.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My boilerplate for cmake projects with ci/cd\n\n[![CMake](https://img.shields.io/badge/CMake-3.26+-blue.svg)](https://cmake.org/)\n[![vcpkg](https://img.shields.io/badge/vcpkg-enabled-green.svg)](https://vcpkg.io/)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![](https://tokei.rs/b1/gitlab/cppshizoid/cmake_boilerplate)](https://github.com/cpp20120/cmake_boilerplate).\n\nStructure:\n\n\n```sh\n├── .github/workflows\n│   └── build_cmake.yml\n├── build(contains generation from cmake(ninja.build) and also contains compile_commands.json\n├── cmake (contains cmake scripts for project)\n├── docs\n|\t└── CMakeLists.txt\n│   └── generate_docs.py\n│   └── Doxyfile.in  \n├── include\n│   └── *.hpp\n├── lib\n|   └──lib1_name (contains first library name)\n|\t\t├── cmake (contains cmake scripts for library)\n|\t\t├── include\n│\t\t\t└── *.hpp\n|\t\t├── src\n│\t\t\t└── CMakeLists.txt\n|\t\t\t└── *.cpp\n|\t\t├── test (contains test for lib)\n|\t\t└── CMakeLists.txt\n|\t\t└── lib_test_*.cpp(name will changes to library component name)\n|   └──lib2_name (contains second library name)\n|\t\t├── cmake (contains cmake scripts for library)\n|\t\t├── include\n│\t\t\t└── *.hpp\n|\t\t├── src\n│\t\t\t└── CMakeLists.txt\n|\t\t\t└── *.cpp\n|\t\t├── test (contains test for lib)\n|\t\t└── CMakeLists.txt\n|\t\t└── lib_test_*.cpp(name will changes to library component name)\n│── shaders(for graphics project)\n│   └── *.frag/.vert\n├── src\n│   └── CMakeLists.txt\n│   └── *.cpp\n├── test\n|   └──fuzz_test (contains fuzz tests)\n|       └──CMakeLists.txt\n│   └── CMakeLists.txt\n│   └── test_*.cpp\n├── .clang-format\n├── .clang-tidy\n├── .gitignore\n├── build_all.(ps/sh) (build all script for unix and windows)\n├── CMakeLists.txt\n├── CMakePresets.json\n├── compile_commands.json -\u003e build/compile_commands.json(for clangd in nvim/vsc)\n├── vcpkg.json\n├── Dockerfile\n├── LICENSE\n└── README.md\n```\n\nI use  [vcpkg](https://vcpkg.io/en/index.html) for pm(in [windows \u0026 linux](https://github.com/cppshizoidS/cmake_boilerplate/tree/vcpkg)), [cmake](https://cmake.org/) for generator files for [ninja-build](https://ninja-build.org/), [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for format and [doxygen](https://www.doxygen.nl/manual/index.html) for generate docs, [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) for linting, [libfuzzer](https://llvm.org/docs/LibFuzzer.html) for fuzz tests.\nGTest for Unit Test and Ctest for running tests. Lcov/Gcov for test coverage.  It can be used for graphics project. \n\n\n---\nThis template contains everything you need:\n* ready CMakeLists.txt with specific options for windows \n* cmake presets\n* vcpkg.json\n* cript for install all needed packages(for debain based, fedora, arch based \u0026 macos)\n* github.ci/gitlab.ci\n* .gitignore\n* clang-format\n* clang-tidy\n* cmake-format\n* gcov, lcov\n* mold/lld linker(available for gcc/clang)\n* lib build flags\n* library versioning\n* setuped doxygen(with graphviz)\n* setuped installers for windows(NSIS) and packages for deb and rpm\n* caching on ci\n* basic setup for nvim zsh OMZ\n* IWYU\n* setuped CTest and GTest\n* setuped fuzz testing\n* shader build script\n* different configurations: debug, release...\n* debug configs enable flags for most checks for compilers (clang/gcc and msvc)(some may confict need to pick what and when need)\n* docker setup\n* static analysis tools setuped\n* sanizers setuped\n* scritps for parallel formatting (code and cmake)\n* Visual Studio cmake settings preset pick\n\n### Build Debug\n\n```sh\nmkdir -p build/debug\ncd build/debug\ncmake --preset debug\ncmake --build --preset build-debug\n```\n\n### Build Release:\n```sh\nmkdir -p build/release\ncd build/release\ncmake --preset release\ncmake --build --preset build-release\n```\n\n### Vcpkg debug build:\n```sh\ncmake --preset vcpkg-debug\ncmake --build --preset build-vcpkg-debug\n```\n\n### Vcpkg release  build:\n```sh\ncmake --preset vcpkg-release\ncmake --build --preset build-vcpkg-release\n```\n\n\n### Build with sanitazers:\n\n## Address sanitizer\n```sh\ncmake --preset debug-sanitize-address\ncmake --build --preset build-debug-sanitize-address\n```\n## Thread sanitizer\n```sh\ncmake --preset debug-sanitize-thread\ncmake --build --preset build-debug-sanitize-thread\n```\n## Undefined behavior sanitizer\n```sh\ncmake --preset debug-sanitize-undefined\ncmake --build --preset build-debug-sanitize-undefined```\n```\n(specify sanitizer what you need)\n\n### Testing\n\n## Run Fuzz Testing\n\n```sh\ncmake -B build -DENABLE_FUZZING=ON -DCMAKE_CXX_COMPILER=clang++\ncmake --build build --target fuzz_target\n```\n\nManually\n\n```sh\n./build/fuzz/fuzz_target ./fuzz/corpus -max_len=1024 -runs=100000\n```\n\nFrom CTest\n\n```sh\nctest -R fuzz_target_test\n```\n\nAuto crash test\n```sh\nmkdir -p artifacts/crashes\n./build/fuzz/fuzz_target -artifact_prefix=artifacts/crashes/\n```\n\n\nWith vcpkg \n```sh\ncmake --preset fuzz-vcpkg\ncmake --build --preset build-fuzz-vcpkg\n```\n\n## Run all tests (release build)\n```sh\nctest --preset test-all\n```\n\n## Run tests with address sanitizer\n```sh\nctest --preset test-sanitize-address\n```\n\n## Run specific test suite\n```sh\nctest --preset test-library1\n```\n\n## Run docs generation\n```sh\ncmake --build . --target docs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpp20120%2Fcmake_boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpp20120%2Fcmake_boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpp20120%2Fcmake_boilerplate/lists"}