Cookiecutter template for developing modern C++ static libraries and programs.
Here is the technology stack that the bootstrapped project employs to lay the groundwork for a well managed and maintained C++ development project, and hence provide the developers with a better experience throughout the developement life cycle:
- GoogleTest : Performs unit testing and supports TDD.
- CMake : Simplifies cross-platform build and test processes.
- Build scripts : Automates test-running in each build and makes build process even simpler.
- ClangFormat : Keeps the coding style consistent across files in the project.
- Doxygen : Generates documentation in HTML, XML, and LaTeX formats from formatted comment blocks in source files.
- Sphinx docs : Generates static documentation site from documentation text file in reStructedText (reST) format.
- Breathe (Sphinx plugin) : Bridges the gap between Doxygen generated XML and Sphinx's expected reST.
- Furo (Sphinx theme) : Gives the documentation site a clean and modern look.
.
├── src/
├── test/
├── scripts/
├── docs/
├── build/ # to be created in the first build
├── bin/ # to be created in the first build
├── include/ # to be created in the first build
├── lib/ # to be created in the first build
├── .clang-format
├── ProjectConfig.h.in
├── CMakeLists.txt
├── Doxyfile
├── LICENSE
└── README.md
Header and source files for the library and demo program are located in the src/
subdirectory, whereas those for unit tests are located in the test/
subdirectory.
By default, a BSD 3-Clause license is included in the bootstrapped project. You'll need to update or remove it if it doesn't meet your project's licensing requirement. Make sure you've done so before releasing your software.
- g++ (version 8+) or equivalent compiler that supports C++20 and above
- CMake (version 3.15+)
- Make (or equivalent build tool)
- GoogleTest (to be installed as submodule of the project using git)
- Git
- Doxygen 1.9.2+
- Python 3.7+
- Sphinx
- Furo
- Breathe
- LaTeX (optional; only if you need to generate documentation in LaTeX format)
Install the latest Cookiecutter if you haven't installed it yet. You may do so using pip, assuming you have Python 3 installed on Linux, macOS, or Windows:
pip install -U cookiecutter
On Debian-based Linux, alternatively, you may install it via the package manager apt
:
sudo apt install cookiecutter
To bootstrap your project, run Cookiecutter with this template:
cookiecutter https://github.com/KriztoferY/cpp-lib-cookiecutter
Equivalently:
cookiecutter gh:KriztoferY/cpp-lib-cookiecutter
You'll then be prompted with a series of questions, for which the answers will be used to customize the bootstrapped project.
IMPORTANT : library_name
cannot be empty.
This Cookiecutter template is licensed under the BSD 3-Clause License.
The Acknowledgement section in the bootstrapped project README file should be retained without modification throughout the lifetime of your project.
Copyright © 2022 - 2023 KriztoferY. All rights reserved.