C++ project template with unit-tests, documentation, ci-testing and workflows.
MIT License
This is the final project of my Udemy Course. See here to get the full discount to all of my Udemy Courses: Link
This is a template for modern C++ projects. What you get is:
├── CMakeLists.txt
├── app
│ ├── CMakesLists.txt
│ └── main.cc
├── cmake
│ └── cmake modules
├── docs
│ ├── Doxyfile
│ └── html/
├── external
│ ├── CMakesLists.txt
│ ├── ...
├── src
│ ├── CMakesLists.txt
│ ├── foo/...
│ └── bar/...
└── tests
├── CMakeLists.txt
└── test_*.cc
Library code goes into src/, main program code in app/ and tests go in tests/.
First, clone this repo and do the preliminary work:
git clone --recursive https://github.com/franneck94/CppProjectTemplate
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --target main
cd app
./main
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE="Debug"
cmake --build build --config Debug
cd build
ctest .
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target docs
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=On
cmake --build build --config Debug --target coverage -j4
cd build
ctest .
For more info about CMake see here.