{"id":13339547,"url":"https://github.com/dstrebkov/cpp-cmake-project-template","last_synced_at":"2025-03-11T14:31:42.705Z","repository":{"id":154360759,"uuid":"598131754","full_name":"dstrebkov/cpp-cmake-project-template","owner":"dstrebkov","description":"CMake based C++ Project Template","archived":false,"fork":false,"pushed_at":"2023-05-13T17:03:47.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T02:30:32.420Z","etag":null,"topics":["c-plus-plus","cmake","cpp","doctest","fakeit","gcov","gcovr","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","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/dstrebkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2023-02-06T13:21:44.000Z","updated_at":"2023-05-12T07:39:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4df52f5f-9a4c-44ed-989e-0c93ccd36f9b","html_url":"https://github.com/dstrebkov/cpp-cmake-project-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dstrebkov%2Fcpp-cmake-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dstrebkov%2Fcpp-cmake-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dstrebkov%2Fcpp-cmake-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dstrebkov%2Fcpp-cmake-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dstrebkov","download_url":"https://codeload.github.com/dstrebkov/cpp-cmake-project-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243051900,"owners_count":20228290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c-plus-plus","cmake","cpp","doctest","fakeit","gcov","gcovr","testing","unit-testing"],"created_at":"2024-07-29T19:20:21.724Z","updated_at":"2025-03-11T14:31:42.648Z","avatar_url":"https://github.com/dstrebkov.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"cpp-cmake-project-template\n================\n\n![github-actions](https://github.com/dstrebkov/cpp-cmake-project-template/actions/workflows/cmake.yml/badge.svg?event=push)\n[![codecov](https://codecov.io/gh/dstrebkov/cpp-cmake-project-template/branch/main/graph/badge.svg?token=ZH1RSUGL5R)](https://codecov.io/gh/dstrebkov/cpp-cmake-project-template)\n![language](https://img.shields.io/github/languages/top/dstrebkov/cpp-cmake-project-template)\n![repo size](https://img.shields.io/github/repo-size/dstrebkov/cpp-cmake-project-template)\n\nCMake based C++ project template that could be used as a starting point for a new C++ project.\n\nCMake ≥ `3.14.0` is required.\n\n## Contents\n\n- static library `factorial` configured with unit testing framework(s);\n\n- application `app_factorial` that links with the library to run some code.\n\n## Unit testing\n\nThe library is configured with [Doctest](https://github.com/doctest/doctest) ([`v2.4.9`](https://github.com/doctest/doctest/releases/tag/v2.4.9)) for unit testing + [FakeIt](https://github.com/eranpeer/FakeIt) ([`2.3.2`](https://github.com/eranpeer/FakeIt/releases/tag/2.3.2)) for mocking.\n\nThese frameworks are obtained from GitHub using CMake's functions `FetchContent_Declare()` and `FetchContent_MakeAvailable()`.\n\n## Project structure\n\n```\n.\n│\n├── app_factorial/             # Factorial application binary\n│   ├── include                # Application includes\n│   ├── src                    # Application sources\n│   │   └── main.cpp           # Main entry of the sample factorial application\n│   ├── test/                  # Application test folder\n│   └── CMakeLists.txt         # Compile script for application\n│\n├── include                    # Place for built library includes\n│\n├── factorial                  # Static library\n│   ├── include                # Library includes\n│   │   └── factorial.h        # Library header\n│   ├── src                    # Library sources\n│   │   └── factorial.cpp      # Library source\n│   ├── test/                  # Library tests\n│   │   ├── factorial_test.cpp # Tests for the library\n│   │   └── CMakeLists.txt     # Compile script for tests of library\n│   └── CMakeLists.txt         # Library compile script\n│\n├── libs                       # Place for built library binaries\n└── CMakeLists.txt             # Main compile script\n```\n\n## Instructions\n\nCompile and make:\n\n```\nmkdir cmake-build\ncd cmake-build/\ncmake ..\nmake\n```\n\nRun `app_factorial` application:\n\n```\ncd app_factorial/\n./app_factorial\n```\n\nRun unit tests (called from `cmake-build` folder):\n\n```\ncd ..\nctest\n```\n\n## Useful Links\n\n* [Doctest Tutorial](https://github.com/doctest/doctest/blob/master/doc/markdown/tutorial.md)\n* [FakeIt Quickstart](https://github.com/eranpeer/FakeIt/wiki/Quickstart)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdstrebkov%2Fcpp-cmake-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdstrebkov%2Fcpp-cmake-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdstrebkov%2Fcpp-cmake-project-template/lists"}