feat: add imgui
Some checks failed
CI / build-and-test (push) Failing after 1m34s

This commit is contained in:
2025-11-13 18:55:31 +13:00
parent 1b32a3d86e
commit c86eb421b1
3 changed files with 38 additions and 1 deletions

4
.gitmodules vendored
View File

@@ -7,3 +7,7 @@
[submodule "external/acutest"]
path = external/acutest
url = https://github.com/mity/acutest
[submodule "external/imgui"]
path = external/imgui
url = https://github.com/ocornut/imgui.git
branch = 1.9.4-docking

View File

@@ -14,7 +14,11 @@ add_subdirectory(external/raylib)
# -------------------------
add_subdirectory(external/angelscript/sdk/angelscript/projects/cmake)
# -------------------------
# Dear ImGui (docking branch)
# -------------------------
# Ensure the submodule exists at external/imgui (added with git submodule)
add_subdirectory(cmake/imgui)
# -------------------------
# Tests
# -------------------------
@@ -61,6 +65,7 @@ target_include_directories(simian PUBLIC
external/angelscript/sdk/angelscript/include
external/angelscript/sdk/add_on/scriptstdstring
external/angelscript/sdk/add_on/scriptbuilder
external/imgui
)
target_link_libraries(simian
@@ -68,6 +73,7 @@ target_link_libraries(simian
angelscript
scriptstdstring
scriptbuilder
imgui
)
# -------------------------

View File

@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.10)
project(imgui_wrapper NONE)
# Root of the imgui submodule
set(IMGUI_ROOT "${CMAKE_SOURCE_DIR}/external/imgui")
if(NOT EXISTS "${IMGUI_ROOT}/imgui.h")
message(FATAL_ERROR "ImGui not found in ${IMGUI_ROOT}. Run: git submodule update --init --recursive")
endif()
# Gather core sources and optional backend sources if present
file(GLOB IMGUI_CORE_SRCS "${IMGUI_ROOT}/*.cpp")
file(GLOB IMGUI_BACKEND_SRCS "${IMGUI_ROOT}/backends/*.cpp")
# Exclude example / main files if any sneak in
list(FILTER IMGUI_CORE_SRCS EXCLUDE REGEX ".*example.*|.*main.*")
set(IMGUI_SOURCES ${IMGUI_CORE_SRCS} ${IMGUI_BACKEND_SRCS})
add_library(imgui STATIC ${IMGUI_SOURCES})
target_include_directories(imgui PUBLIC
${IMGUI_ROOT}
)
# Optional: keep PIC for static linking on some platforms
set_target_properties(imgui PROPERTIES POSITION_INDEPENDENT_CODE ON)