Skip to content

My personal public template repo for cmake, cpp project

License

Notifications You must be signed in to change notification settings

lightAxis/cmake-cpp-template

Repository files navigation

cmake-cpp-template

simple c++ & cmake project template for Linux with various features

Features

Pre-requisites

Every Dependency in this section is optional

CMake >= 3.12

C++ formatting:

sudo apt install clang-format

CMake formatting:

pip3 install cmake-format

Static code analysis:

sudo apt install cppcheck clang-tidy

Kconfig:

pip3 install kconfiglib

Documentation generation:

pip3 install mkdocs mkdocs-material pymdown-extensions

Testing:

  • Install appropriate version of Catch2 by dpkg or source build

All dependencies can be installed by running the following command

sudo apt install clang-format cppcheck clang-tidy
pip3 install cmake-format kconfiglib mkdocs mkdocs-material pymdown-extensions

Getting Started

Use this repository as a template repository in github or clone this repository

Automatic setup

# prepare template for your project
# set PROJECT_NAME to your project name. Without space(" ")
make prepare_template PROJECT_NAME=$(PROJECT_NAME) 

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

Documentation Generation

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

License

This project is licensed under the MIT License - see the LICENSE file for details

Contact

lightAxis - [email protected]

About

My personal public template repo for cmake, cpp project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published