CMake build script support for Dear ImGui. This builds and installs the library and backends, also builds example programs.
Setting IMGUI_SOURCE_DIR variable on configuration step is mandatory. An example usage might look like this:
Following backend options are available:
| (default) | Unofficial::DearImGui::imgui_core |
| android | Unofficial::DearImGui::imgui_backend_android |
| opengl2 | Unofficial::DearImGui::imgui_backend_opengl2 |
| opengl3 | Unofficial::DearImGui::imgui_backend_opengl3 |
| vulkan | Unofficial::DearImGui::imgui_backend_vulkan |
| allegro5 | Unofficial::DearImGui::imgui_backend_allegro5 |
| glfw | Unofficial::DearImGui::imgui_backend_glfw |
| glut | Unofficial::DearImGui::imgui_backend_glut |
| sdl2 | Unofficial::DearImGui::imgui_backend_sdl2 |
| sdlrenderer2 | Unofficial::DearImGui::imgui_backend_sdlrenderer2 |
| sdl3 | Unofficial::DearImGui::imgui_backend_sdl3 |
| sdlgpu3 | Unofficial::DearImGui::imgui_backend_sdlgpu3 |
| sdlrenderer3 | Unofficial::DearImGui::imgui_backend_sdlrenderer3 |
| win32 | Unofficial::DearImGui::imgui_backend_win32 |
| dx9 | Unofficial::DearImGui::imgui_backend_dx9 |
| dx10 | Unofficial::DearImGui::imgui_backend_dx10 |
| dx11 | Unofficial::DearImGui::imgui_backend_dx11 |
| dx12 | Unofficial::DearImGui::imgui_backend_dx12 |
All backend options are OFF by default.
Example programs set as dependent options, like:
The example_sdl2_opengl3 option will be available only when the examples option and the corresponding backends (sdl2 and opengl3) are ON. This is true for all the other examples. No install rules are written for example programs.
Following projects are also supported:
| imgui_club | IMGUI_CLUB_SOURCE_DIR | imgui_club imgui_memory_editor imgui_multicontext_compositor imgui_threaded_rendering |
Unofficial::imgui_club::imgui_memory_editor Unofficial::imgui_club::imgui_multicontext_compositor Unofficial::imgui_club::imgui_threaded_rendering |
| imgui_markdown | IMGUI_MARKDOWN_SOURCE_DIR | imgui_markdown | Unofficial::imgui_markdown::imgui_markdown |
| ImPlot | IMPLOT_SOURCE_DIR | implot | Unofficial::ImPlot::implot Unofficial::ImPlot::implot_demo |
| ImPlot3D | IMPLOT3D_SOURCE_DIR | implot3d | Unofficial::ImPlot3D::implot3d Unofficial::ImPlot3D::implot3d_demo |
All the include paths are kept as is. This repo demonstrates how to build programs as a client of the library:
The following backends and their example programs are missing:
- WGPU backend
- Metal backend (macOS)
- macOS platform backend
See help-wanted tags in Issues.
.png)

