ikraduya / CPP-Project-Boilerplate

C++ Project Boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ Project Boilerplate

github CI status

Set-up the minimum project structure and boilerplate code for modern C++ (C++17). Including:

  • Sources, headers, and mains separated in distinct folders
  • CMake for compiling
  • Tests using 'Google tests'
  • CPPLint.cfg to store cpplint configuration
  • .gitignore for C++ project
  • CI using Github Actions

Structure

.
├── CMakeLists.txt
├── app
│   └── main.cpp
├── include
│   └── exampleClass.hpp
├── src
│   └── exampleClass.cpp
└── tests
    ├── CMakeLists.txt
    ├── exampleTest.cpp
    └── anotherTest.cpp

Building using CMake

> cmake -S . -B build -DCMAKE_BUILD_TYPE=[Debug | Release]
> cmake --build build
> cd build
> ./main
> ctest # Run tests

For build type, you must choose between Debug or Release

About

C++ Project Boilerplate


Languages

Language:C++ 52.4%Language:CMake 47.6%