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-debug
make-gcc-release
make-gcc-debug-coverage
make-clang-debug
make-clang-debug-sanitize-address
make-clang-debug-sanitize-leak
make-clang-debug-sanitize-memory
make-clang-debug-sanitize-thread
make-clang-debug-sanitize-undefined
make-clang-debug-xray
make-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:
LCOV
coverage file inbuild/make-gcc-debug-coverage/lcov.info
HTML
coverage 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