Skip to content

timetravelCat/cpp-cmake-template

Repository files navigation

cpp-cmake-template

Features

Prerequisites

All requirements are optional.

Formatting Requirements

pip install cmake-format
sudo apt install clang-format 

Documentation Requirements

pip install mkdocs mkdocs-material pymdown-extensions mkdocs-dracula-theme 

Kconfig Requirements

pip install kconfiglib

Testing Requirements

  • Install appropriate version of Catch2.

Static Analyzers Requirements

sudo apt install cppcheck clang-tidy

Getting Started

Automatic Setup

make initialize PROJECT_NAME=$(PROJECT_NAME) # set PROJECT_NAME name without "".

Manual Setup

  • Change cmake/cpp-cmake-templateConfig.cmake.in to cmake/$(PROJECT_NAME)Config.cmake.in
  • Change include/cpp-cmake-template to include/$(PROJECT_NAME)
  • Replace 'cpp-cmake-template' to '$(PROJECT_NAME)' of CMakeLists.txt

Documentations

MkDocs tutorial

Go to the settings of your repository and ensure that the publishing source branch for your GitHub Page is set to gh-pages

Running examples

mkdir -p build && cd build
cmake .. -DBUILD_EXAMPLE=ON
cmake --build .
make run_examples # if you want to run all examples

Running the tests

mkdir -p build && cd build
cmake .. -DBUILD_TESTING=ON
cmake --build .
ctest # or make test

License

This project is licensed under the BSD-3-Clause - see the LICENSE file for details

Contact

timetravelCat - timetraveler930@gmail.com