{"id":15136941,"url":"https://github.com/franneck94/cppprojecttemplate","last_synced_at":"2025-04-06T04:15:14.877Z","repository":{"id":46978534,"uuid":"278295621","full_name":"franneck94/CppProjectTemplate","owner":"franneck94","description":"C++ project template with unit-tests, documentation, ci-testing and workflows.","archived":false,"fork":false,"pushed_at":"2024-07-15T14:10:38.000Z","size":564,"stargazers_count":264,"open_issues_count":5,"forks_count":97,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-06T04:15:04.202Z","etag":null,"topics":["catch2","clang","clang-format","clang-tidy","cmake","cmakelists","codecov","conan","coverage","doxygen","github-actions","github-pages","logging","make","msvc","sanitizer","testing","vscode"],"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/franneck94.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":"2020-07-09T07:34:04.000Z","updated_at":"2025-04-02T14:13:04.000Z","dependencies_parsed_at":"2023-01-25T17:01:31.739Z","dependency_job_id":"71cba721-101e-4a6a-9923-cd296f90b5db","html_url":"https://github.com/franneck94/CppProjectTemplate","commit_stats":null,"previous_names":[],"tags_count":14,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franneck94%2FCppProjectTemplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franneck94%2FCppProjectTemplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franneck94%2FCppProjectTemplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franneck94%2FCppProjectTemplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franneck94","download_url":"https://codeload.github.com/franneck94/CppProjectTemplate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430963,"owners_count":20937875,"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":["catch2","clang","clang-format","clang-tidy","cmake","cmakelists","codecov","conan","coverage","doxygen","github-actions","github-pages","logging","make","msvc","sanitizer","testing","vscode"],"created_at":"2024-09-26T06:42:00.756Z","updated_at":"2025-04-06T04:15:14.609Z","avatar_url":"https://github.com/franneck94.png","language":"CMake","readme":"# Template For C++ Projects\n\n![C++](https://img.shields.io/badge/C%2B%2B-11%2F14%2F17%2F20%2F23-blue)\n![License](https://img.shields.io/github/license/franneck94/CppProjectTemplate)\n![Linux Build](https://github.com/franneck94/CppProjectTemplate/workflows/Ubuntu%20CI%20Test/badge.svg)\n\n**This is the final project of my Udemy Course**.\nSee here to get the full discount to all of my Udemy Courses: [Link](https://github.com/franneck94/YoutubeVideos/blob/main/EnglishCourses.md)\n\nThis is a template for modern C++ projects.\nWhat you get is:\n\n- Library, executable and test code separated in distinct folders\n- Use of modern CMake for building and compiling\n- External libraries installed and managed by\n  - [CPM](https://github.com/cpm-cmake/CPM.cmake) Package Manager **OR**\n  - [Conan](https://conan.io/) Package Manager **OR**\n  - [VCPKG](https://github.com/microsoft/vcpkg) Package Manager\n- Unit testing using [Catch2](https://github.com/catchorg/Catch2) v2\n- General purpose libraries: [JSON](https://github.com/nlohmann/json), [spdlog](https://github.com/gabime/spdlog), [cxxopts](https://github.com/jarro2783/cxxopts) and [fmt](https://github.com/fmtlib/fmt)\n- Continuous integration testing with Github Actions and [pre-commit](https://pre-commit.com/)\n- Code documentation with [Doxygen](https://doxygen.nl/) and [Github Pages](https://franneck94.github.io/CppProjectTemplate/)\n- Tooling: Clang-Format, Cmake-Format, Clang-tidy, Sanitizers\n\n## Structure\n\n``` text\n├── CMakeLists.txt\n├── app\n│   ├── CMakesLists.txt\n│   └── main.cc\n├── cmake\n│   └── cmake modules\n├── docs\n│   ├── Doxyfile\n│   └── html/\n├── external\n│   ├── CMakesLists.txt\n│   ├── ...\n├── src\n│   ├── CMakesLists.txt\n│   ├── foo/...\n│   └── bar/...\n└── tests\n    ├── CMakeLists.txt\n    └── test_*.cc\n```\n\nLibrary code goes into [src/](src/), main program code in [app/](app) and tests go in [tests/](tests/).\n\n## Software Requirements\n\n- CMake 3.21+\n- GNU Makefile\n- Doxygen\n- Conan or VCPKG\n- MSVC 2017 (or higher), G++9 (or higher), Clang++9 (or higher)\n- Optional: Code Coverage (only on GNU|Clang): gcovr\n- Optional: Makefile, Doxygen, Conan, VCPKG\n\n## Building\n\nFirst, clone this repo and do the preliminary work:\n\n```shell\ngit clone --recursive https://github.com/franneck94/CppProjectTemplate\nmkdir build\n```\n\n- App Executable\n\n```shell\ncd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\ncmake --build . --config Release --target main\ncd app\n./main\n```\n\n- Unit testing\n\n```shell\ncmake -H. -Bbuild -DCMAKE_BUILD_TYPE=\"Debug\"\ncmake --build build --config Debug\ncd build\nctest .\n```\n\n- Documentation\n\n```shell\ncd build\ncmake -DCMAKE_BUILD_TYPE=Debug ..\ncmake --build . --config Debug --target docs\n```\n\n- Code Coverage (Unix only)\n\n```shell\ncmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On\ncmake --build build --config Debug --target coverage -j4\ncd build\nctest .\n```\n\nFor more info about CMake see [here](./README_cmake.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranneck94%2Fcppprojecttemplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranneck94%2Fcppprojecttemplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranneck94%2Fcppprojecttemplate/lists"}