{"id":20766218,"url":"https://github.com/navono/cpp-project-template","last_synced_at":"2026-03-16T10:04:13.099Z","repository":{"id":74496118,"uuid":"349273614","full_name":"navono/cpp-project-template","owner":"navono","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-30T05:38:03.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"demo","last_synced_at":"2025-02-26T03:36:24.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/navono.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":"2021-03-19T02:10:39.000Z","updated_at":"2021-07-30T05:38:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"719ae8b5-63a7-4341-beee-f3462c447b34","html_url":"https://github.com/navono/cpp-project-template","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/navono%2Fcpp-project-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fcpp-project-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fcpp-project-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navono%2Fcpp-project-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navono","download_url":"https://codeload.github.com/navono/cpp-project-template/tar.gz/refs/heads/demo","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243093969,"owners_count":20235469,"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":[],"created_at":"2024-11-17T11:22:03.652Z","updated_at":"2025-12-24T10:12:03.784Z","avatar_url":"https://github.com/navono.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"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\n\u003e mkdir build \u0026\u0026 cd build\n\u003e cmake .. -DCMAKE_BUILD_TYPE=[Debug | Coverage | Release]\n\u003e make\n\u003e ./main\n\u003e make test      # Makes and runs the tests.\n\u003e make coverage  # Generate a coverage report.\n\u003e make 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**NB**: GitHub templates do not carry over submodules, which means you need to add those back _before_ you can build the project. Run the following after you have generated your new project:\n``` bash\n\u003e git clone https://github.com/\u003cyour-username\u003e/\u003cyour-repo-name\u003e\n\u003e git submodule add https://github.com/onqtam/doctest.git external/doctest\n\u003e git commit -a --amend --no-edit\n\u003e git push --force\n```\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\n\u003e git clone --recurse-submodules https://github.com/bsamseth/cpp-project  # Or use ssh-link if you like.\n\u003e cd cpp-project\n\u003e bash setup.sh\n```\nThe result is a fresh Git repository with one commit adding all files from the boiler plate. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavono%2Fcpp-project-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavono%2Fcpp-project-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavono%2Fcpp-project-template/lists"}