This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
# -------------------------
|
||||
|
||||
27
cmake/imgui/CMakeLists.txt
Normal file
27
cmake/imgui/CMakeLists.txt
Normal 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)
|
||||
Reference in New Issue
Block a user