Skip to content

This repository contains a template used when creating new C++ library

License

Unlicense, MIT licenses found

Licenses found

Unlicense
LICENSE.md
MIT
LICENSE_mit.md
Notifications You must be signed in to change notification settings

legerch/library-template

Repository files navigation

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:

1. Files to set

This is only a template repository, multiple files need to be adjusted:

  • README.md (available via README_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 files
    • libraryglobal.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 needed
    • testshelper.cpp: Set macro used to get path of external tests ressources

2. Tools version used

Tools minimal versions set are:

  • Minimum C++ standard: C++ 17
  • Standard used (main CMakeList): C++ 17
  • CMake: 3.19
  • Google tests: 1.11.0

3. Library helper

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

4. Template details

This library template use the Pitchfork convention (see associated repository) to keep separated public API and private sources

About

This repository contains a template used when creating new C++ library

Resources

License

Unlicense, MIT licenses found

Licenses found

Unlicense
LICENSE.md
MIT
LICENSE_mit.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages