Template for a CMake based C++ projects using vscode's devcontainer to have a reproducible development environment
.devcontainer/Dockerfile includes a set tools to compile, debug and test the project, for example:
- gcc
- g++
- gdb
- clang
- clang++
- clang-format
- clang-tidy
- cmake
- ccache
- git
- python3
- valgrind
devcontainer.json configures vscode settings and plugins
CMakePresets.json includes definitions for several CMake presets
make-gcc-debugmake-gcc-releasemake-gcc-debug-coveragemake-clang-debugmake-clang-debug-sanitize-addressmake-clang-debug-sanitize-leakmake-clang-debug-sanitize-memorymake-clang-debug-sanitize-threadmake-clang-debug-sanitize-undefinedmake-clang-debug-xraymake-clang-release
Each preset creates a directory inside build, example: build/make-gcc-debug
- Configure
cmake --preset make-gcc-debug
- Build
cmake --build --preset make-gcc-debug
- Test
ctest --preset make-gcc-debug
- Workflow
cmake --workflow --preset make-gcc-debug
cmake --workflow --preset static-analysis runs:
clang-tidy
cmake --workflow --preset make-gcc-debug-coverage generates:
LCOVcoverage file inbuild/make-gcc-debug-coverage/lcov.infoHTMLcoverage report inbuild/make-gcc-debug-coverage/lcov/index.html
changes to master branch triggers an action to deploy the coverage report to github pages
changes to dev branch triggers an action to deploy the coverage report to github pages
mkdir -p build
doxygen Doxyfile
changes to master branch triggers an action to deploy the documentation to github pages
changes to dev branch triggers an action to deploy the documentation to github pages