A C++ GitHub template project.
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.
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
- 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)
- 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
Documentation can be found at https://ben1980.github.io/cpptemplate/
Benjamin Mahr – GitHub
– LinkedIn
– Twitter
– Mail
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/Ben1980/cpptemplate/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
- Converting CTest results int JUnit XML – https://stackoverflow.com/a/21688776/1541782
- README.md template inspiration – https://github.com/dbader/readme-template
- Doxygen GitHub-Action – https://github.com/mattnotmitt/doxygen-action
- gh-pages GitHub-Action – https://github.com/peaceiris/actions-gh-pages
- Dockerfile Tips – https://blog.container-solutions.com/6-dockerfile-tips-official-images