This is a template for my C++ projects. It contains the boilerplate code for some useful programs, currently:
- CMake
- Docker containers (including integration with VSCode)
- Doctest
- Doxygen
- Git
- Github actions (i.e. continuous integration)
and a tiny program to be documented with Doxygen.
Surely there exist much better ways of configuring the programs, this is the best I can currently do.
While not strictly dependencies, Visual Studio Code, Docker and the VS Code Dev Containers extension are required to have all available functionalities.
- To test that Docker works as expected, use
docker run hello-world
- After building the container inside VS Code, use
and one of
cmake -S . -B build -DBUILD_TESTING=ON cmake --build build
andbuild/exec
to test the program or the tests, respectively.cd build make test
- To generate the documentation, use
then open
doxygen
html/index.html
in a browser. - To test the debugger, either
- launch "Build main and debug" from the designated section of VS Code, or
- open a test, then launch "Build this test and debug".
I chose Debian as a container instead of lighter distros due to familiarity.
I committed the .clang-format
due to easiness of retrieval.
There is an error message while building the container:
Error: there is no registered task type 'cppbuild'. Did you miss installing an extension that provides a corresponding task provider?
It is completely harmless. See the related issue.
- More continuous integration.
- Move
.clang-format
into a repository for dotfiles.