Skip to content

Commit

Permalink
cmake: run git submodule update --init if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Dec 17, 2023
1 parent f465c27 commit 8311591
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ endif()
# set(HELLOIMGUI_IMGUI_SOURCE_DIR "path/to/your/imgui" CACHE STRING "" FORCE)
#
if (HELLOIMGUI_BUILD_IMGUI)
# if HELLOIMGUI_IMGUI_SOURCE_DIR is CMAKE_CURRENT_LIST_DIR/imgui
# and the submodule is not present, update submodules
if (HELLOIMGUI_IMGUI_SOURCE_DIR STREQUAL ${CMAKE_CURRENT_LIST_DIR}/imgui)
if (NOT EXISTS ${HELLOIMGUI_IMGUI_SOURCE_DIR}/imgui.h)
# Run git submodule update --init --recursive
message(WARNING "Updating imgui submodule")
execute_process(COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()
endif()

file(GLOB imgui_sources ${HELLOIMGUI_IMGUI_SOURCE_DIR}/*.h ${HELLOIMGUI_IMGUI_SOURCE_DIR}/*.cpp)
set(imgui_sources ${imgui_sources} ${HELLOIMGUI_IMGUI_SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp ${HELLOIMGUI_IMGUI_SOURCE_DIR}/misc/cpp/imgui_stdlib.h)
if (HELLO_IMGUI_IMGUI_SHARED)
Expand Down

0 comments on commit 8311591

Please sign in to comment.