This repository contains a template used when creating new C++ library. Multiple type of libraries are available:
- Native
- Qt compatible
Tip
Quick link to interesting macros
Table of contents:
This is only a template repository, multiple files need to be adjusted:
README.md
(available viaREADME_library.md
)LICENSE.md
Doxyfile
CHANGELOG.md
CMakeLists
: Choose between native and Qt, then set project name, dependencies, etc...include/libname/
: Rename it to library name. This folder will contains all public API fileslibraryglobal.h.in
: Choose native/Qt, better to rename to actual library name, set macros to better library names. Also note that this file is a.h.in
file, the associated header will automatically be generated by CMake
src/
: This folder will contains all private files (.cpp
or.hpp
)tests/
:CMakeLists.txt
: Choose between native and Qt, then set tests name, dependencies, etc...main.cpp
: File not needed if no custom test main loop is neededtestshelper.cpp
: Set macro used to get path of external tests ressources
Tools minimal versions set are:
- Minimum C++ standard: C++ 17
- Standard used (main
CMakeList
): C++ 17 - CMake:
3.19
- Google tests:
1.11.0
Those helpers can also be useful when creating new C++ library:
- AbstractLogger: Abstract logger implementation example that allow to have a logging behaviour inside of a library without being tied to a specific logging library API, allowing application developpers to use their logging behaviour/dependencies.
- Doxygen tutorial
This library template use the Pitchfork convention (see associated repository) to keep separated public API and private sources