ImGuiProjectTemplate

ImGui Template with OpenGL and GLFW

MIT License

Stars
15

Template For C++ Projects

This is a template for C++ projects. What you get:

This is a template for Imgui C++ projects. What you get:

  • Library and executable code separated in distinct folders.
  • Use of modern CMake for building and compiling.
  • External libraries:
    • All graphical and imgui related libs via Git submodules:
      • GLFW, Imgui and Implot
    • General purpose libraries via CMake FetchContent:
  • Continuous integration testing with Github Actions and pre-commit
  • Code documentation with Doxygen and Github Pages
  • Tooling: Clang-Format, Cmake-Format, Clang-tidy, Sanitizers

Structure

├── CMakeLists.txt
├── app
│   ├── CMakesLists.txt
│   └── main.cc
├── cmake
│   └── cmake modules
├── docs
│   ├── Doxyfile
│   └── html/
├── external
│   ├── CMakesLists.txt
│   ├── ...
├── src
│   ├── CMakesLists.txt
└── ─── render/...

Library code goes into src/, main program code in app/.

Software Requirements

  • CMake 3.21+
  • GNU Makefile
  • Doxygen
  • VCPKG
  • MSVC 2017 (or higher), G++9 (or higher), Clang++9 (or higher)

Building

First, clone this repo and do the preliminary work:

git clone --recursive https://github.com/franneck94/CppProjectTemplate
mkdir build
  • App Executable
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --target main
cd app
./main
  • Documentation
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target docs