A template repo to set up a project for a C++ library. Targeted for Linux or MacOS with gcc or clang.
- Includes robust project warnings for gcc and clang
- Sanitizer options
- Clang Tidy, cppcheck, and include-what-you-use support
- Autogenerates documentation from the source code via Doxygen
- Tests with gTest
- Generates code coverage report from tests
- Able to be included in a cmake project as a submodule, or with cmake FetchContent
- After system installation, can be found in a cmake project with
find_package - Optionally uses conan for dependency management, with ability to create conan package for the library from build artifacts.
Requires CMake to build.
For installing dependencies, either Conan or your favorite system package manager can be used.
For generating coverage reports, gcov and gcovr must be installed on the system.
The static analyzers must also be installed to use them.
mkdir build
cd build
conan install ..
conan build ..Before building, install dependencies listed in build_requirements and requirements methods of conanfile.py.
cmake -S . -B build
cmake --build buildRun tests and generate code coverage reports from tests:
cmake --build build --target coverageInstall library on system after building:
cmake --install buildContributions that fix errata are much appreciated. Feel free to reach out to the author about any issues.