diff --git a/.gitignore b/.gitignore index 59d2d01..b1aff46 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ CTestTestfile.cmake _deps CMakeUserPresets.json cmake-build-debug +imgui.ini diff --git a/.gitmodules b/.gitmodules index caf199e..3df74ea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vendor/SDL"] path = vendor/SDL url = git@github.com:libsdl-org/SDL.git +[submodule "vendor/imgui"] + path = vendor/imgui + url = git@github.com:ocornut/imgui.git diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index 9084133..5bba3f5 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -1,4 +1,23 @@ add_subdirectory(SDL) +file(GLOB IMGUI_SOURCES + "imgui/*.cpp" + "imgui/backends/imgui_impl_sdl3.cpp" + "imgui/backends/imgui_impl_sdlrenderer3.cpp" +) + +file(GLOB IMGUI_HEADERS + "imgui/*.h" + "imgui/backends/imgui_impl_sdl3.h" + "imgui/backends/imgui_impl_sdlrenderer3.h" +) + +add_library(imgui STATIC ${IMGUI_SOURCES} ${IMGUI_HEADERS}) +target_include_directories(imgui PUBLIC + "imgui" + "imgui/backends" +) + + add_library(vendor INTERFACE) -target_link_libraries(vendor INTERFACE SDL3::SDL3) \ No newline at end of file +target_link_libraries(vendor INTERFACE SDL3::SDL3 imgui)