{"id":13399749,"url":"https://github.com/bsamseth/cpp-project","last_synced_at":"2025-04-04T08:05:49.656Z","repository":{"id":45025371,"uuid":"52855744","full_name":"bsamseth/cpp-project","owner":"bsamseth","description":"Boiler plate template for C++ projects, with CMake, Doctest, Travis CI, Appveyor, Github Actions and coverage reports.","archived":false,"fork":false,"pushed_at":"2023-09-19T12:15:35.000Z","size":161,"stargazers_count":610,"open_issues_count":2,"forks_count":129,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-28T07:04:00.169Z","etag":null,"topics":["actions","boilerplate","cmake","code-coverage","code-review","codecov","coveralls","cpp","cpp-17","doctest","folder-structure","github-actions","project-template","template-project","travis-ci"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"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/bsamseth.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}},"created_at":"2016-03-01T07:02:30.000Z","updated_at":"2025-03-21T14:39:27.000Z","dependencies_parsed_at":"2024-05-02T20:58:01.662Z","dependency_job_id":"addb90ba-3df0-43cf-8a87-dc2232220b5d","html_url":"https://github.com/bsamseth/cpp-project","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsamseth%2Fcpp-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsamseth%2Fcpp-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsamseth%2Fcpp-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsamseth%2Fcpp-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsamseth","download_url":"https://codeload.github.com/bsamseth/cpp-project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247139919,"owners_count":20890318,"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":["actions","boilerplate","cmake","code-coverage","code-review","codecov","coveralls","cpp","cpp-17","doctest","folder-structure","github-actions","project-template","template-project","travis-ci"],"created_at":"2024-07-30T19:00:42.247Z","updated_at":"2025-04-04T08:05:49.633Z","avatar_url":"https://github.com/bsamseth.png","language":"CMake","readme":"[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![Build Status](https://travis-ci.org/bsamseth/cpp-project.svg?branch=master)](https://travis-ci.org/bsamseth/cpp-project)\n[![Build status](https://ci.appveyor.com/api/projects/status/g9bh9kjl6ocvsvse/branch/master?svg=true)](https://ci.appveyor.com/project/bsamseth/cpp-project/branch/master)\n[![Coverage Status](https://coveralls.io/repos/github/bsamseth/cpp-project/badge.svg?branch=master)](https://coveralls.io/github/bsamseth/cpp-project?branch=master)\n[![codecov](https://codecov.io/gh/bsamseth/cpp-project/branch/master/graph/badge.svg)](https://codecov.io/gh/bsamseth/cpp-project)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/eb004322b0d146239a57eb242078e179)](https://www.codacy.com/app/bsamseth/cpp-project?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=bsamseth/cpp-project\u0026amp;utm_campaign=Badge_Grade)\n[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/bsamseth/cpp-project.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/bsamseth/cpp-project/context:cpp)\n[![Total alerts](https://img.shields.io/lgtm/alerts/g/bsamseth/cpp-project.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/bsamseth/cpp-project/alerts/)\n[![license](https://img.shields.io/badge/license-Unlicense-blue.svg)](https://github.com/bsamseth/cpp-project/blob/master/LICENSE)\n[![Lines of Code](https://tokei.rs/b1/github/bsamseth/cpp-project)](https://github.com/Aaronepower/tokei)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/bsamseth/cpp-project.svg)](http://isitmaintained.com/project/bsamseth/cpp-project \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/bsamseth/cpp-project.svg)](http://isitmaintained.com/project/bsamseth/cpp-project \"Percentage of issues still open\")\n\n# Boiler plate for C++ projects\n\nThis is a boiler plate for C++ projects. What you get:\n\n-   Sources, headers and mains separated in distinct folders\n-   Use of modern [CMake](https://cmake.org/) for much easier compiling\n-   Setup for tests using [doctest](https://github.com/onqtam/doctest)\n-   Continuous testing with [Travis-CI](https://travis-ci.org/), [Appveyor](https://www.appveyor.com) and [GitHub Actions](https://github.com/features/actions), with support for C++17.\n-   Code coverage reports, including automatic upload to [Coveralls.io](https://coveralls.io/) and/or [Codecov.io](https://codecov.io)\n-   Code documentation with [Doxygen](http://www.stack.nl/~dimitri/doxygen/)\n\n![Demo of usage](https://i.imgur.com/foymVfy.gif)\n\n## Structure\n``` text\n.\n├── CMakeLists.txt\n├── app\n│   └── main.cpp\n├── include\n│   ├── example.h\n│   └── exampleConfig.h.in\n├── src\n│   └── example.cpp\n└── tests\n    ├── dummy.cpp\n    └── main.cpp\n```\n\nSources go in [src/](src/), header files in [include/](include/), main programs in [app/](app), and\ntests go in [tests/](tests/) (compiled to `unit_tests` by default).\n\nIf you add a new executable, say `app/hello.cpp`, you only need to add the following two lines to [CMakeLists.txt](CMakeLists.txt):\n\n```cmake\nadd_executable(main app/main.cpp)   # Name of exec. and location of file.\ntarget_link_libraries(main PRIVATE ${LIBRARY_NAME})  # Link the executable to lib built from src/*.cpp (if it uses it).\n```\n\nYou can find the example source code that builds the `main` executable in [app/main.cpp](app/main.cpp) under the `Build` section in [CMakeLists.txt](CMakeLists.txt).\nIf the executable you made does not use the library in [src/](src), then only the first line is needed.\n\n\n\n## Building\n\nBuild by making a build directory (i.e. `build/`), run `cmake` in that dir, and then use `make` to build the desired target.\n\nExample:\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=[Debug | Coverage | Release]\nmake\n./main\nmake test      # Makes and runs the tests.\nmake coverage  # Generate a coverage report.\nmake doc       # Generate html documentation.\n```\n\n## .gitignore\n\nThe [.gitignore](.gitignore) file is a copy of the [Github C++.gitignore file](https://github.com/github/gitignore/blob/master/C%2B%2B.gitignore),\nwith the addition of ignoring the build directory (`build/`).\n\n## Services\n\nIf the repository is activated with Travis-CI, then unit tests will be built and executed on each commit.\nThe same is true if the repository is activated with Appveyor.\n\nIf the repository is activated with Coveralls/Codecov, then deployment to Travis will also calculate code coverage and\nupload this to Coveralls.io and/or Codecov.io\n\n## Setup\n\n### Using the GitHub template\nClick the `Use this template` button to make a new repository from this template.\n\n### From command line\nWhen starting a new project, you probably don't want the history of this repository. To start fresh you can use\nthe [setup script](setup.sh) as follows:\n```bash\ngit clone https://github.com/bsamseth/cpp-project  # Or use ssh-link if you like.\ncd cpp-project\nbash setup.sh\n```\nThe result is a fresh Git repository with one commit adding all files from the boiler plate.\n","funding_links":[],"categories":["CMake","Tools","Examples / Templates"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsamseth%2Fcpp-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsamseth%2Fcpp-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsamseth%2Fcpp-project/lists"}