My Project
cpptemplate

A C++ GitHub template project.

CircleCI CodeFactor Grade Documentation License

A C++ GitHub template project consisting of a circleci build pipeline utilising cmake, ctest, vcpkg, and an automated documentation deployment via GitHub-Actions at gh-pages branch.

Getting Started

To build the project:

  • Setup toolchain ~/PROJECTNAME/build/cmake .. -DCMAKE_TOOLCHAIN_FILE={YOUR_PATH_TO_VCPKG}/scripts/buildsystems/vcpkg.cmake
  • Build ~/PROJECTNAME/build/cmake --build . --config Release
  • Execute the tests ~/PROJECTNAME/build/ctest
  • You can execute the program by ./build/app/PROJECTNAME

To update the docker image:

  • Edit the Dockerfile to your needs
  • Build docker image sudo docker build -t IMAGENAME .
  • Tag docker image with dockerhub username sudo docker tag IMAGENAME:TAG DOCKERHUBUSERNAME/IMAGENAME:TAG
  • Push docker image to dockerhub sudo docker push DOCKERHUBUSERNAME/IMAGENAME:TAG

To change/add dependencies:

  • Edit the vcpkg part of .cirlceci/config.yml to your needs
    - run:
    name: Install vcpkg dependencies
    command: ./../../vcpkg/vcpkg install DEPENDENCIES

Prerequisites/Dependencies

  • cmake – Open-Source, cross-platform build tool
  • fmt – External library used for formatting and printing results
  • doctest – Feature-rich C++11/14/17/20 single-header testing framework for unit tests and TDD
  • vcpkg – C++ Library Manager for Windows, Linux, and MacOS
  • python 3 – A programming language used to convert ctest results with a xml transformation (xslt)

Release History

  • 1.1.0
    • CHANGED: README.md extended and several links corrected
    • CHANGED: Dockerfile cleaned up which also lead to a slightly smaller docker image
  • 1.0.0
    • ADD: Customized docker image for C++/cmake builds with vcpkg as dependency manager
    • ADD: GitHub action to generate documentation
    • ADD: GitHub project template

Meta

Documentation can be found at https://ben1980.github.io/cpptemplate/

Benjamin MahrGitHub
                          – LinkedIn
                          – Twitter
                          – Mail

Distributed under the MIT license. See LICENSE for more information.

Contributing

  1. Fork it (https://github.com/Ben1980/cpptemplate/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (‘git commit -am 'Add some fooBar’)
  4. Push to the branch (git push origin feature/fooBar`)
  5. Create a new Pull Request

Acknowledgments