From 1a5f99d69a7422bf0ef61969594ef557c1d2b7ce Mon Sep 17 00:00:00 2001 From: Light Date: Sat, 5 Mar 2022 19:36:04 +0330 Subject: [PATCH] Modify(submodules): imgui --- .gitmodules | 3 ++- Dependencies/CMakeLists.txt | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Dependencies/CMakeLists.txt diff --git a/.gitmodules b/.gitmodules index 74da80c..f6b2cc4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,8 @@ url = https://github.com/g-truc/glm [submodule "Dependencies/imgui"] path = Dependencies/imgui - url = https://github.com/Light3039/imgui + url = https://github.com/ocornut/imgui + branch = docking [submodule "Dependencies/entt"] path = Dependencies/entt url = https://github.com/skypjack/entt diff --git a/Dependencies/CMakeLists.txt b/Dependencies/CMakeLists.txt new file mode 100644 index 0000000..0b8cb0c --- /dev/null +++ b/Dependencies/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.14) + +if (CMAKE_COMPILER_IS_GNUCC) + add_compile_options(-w) +endif() +if(MSVC) + add_compile_options(/MP) + add_compile_options(/W0) +endif() + +file(GLOB IMGUI_FILES true ABSOLUTE +${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) + +set(BACKENDS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/backends/) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +file(GLOB IMGUI_BACKEND_FILES true ABSOLUTE +${BACKENDS_DIR}imgui_impl_opengl3.cpp ${BACKENDS_DIR}imgui_impl_opengl3.h +# ${BACKENDS_DIR}imgui_impl_vulkan.cpp ${BACKENDS_DIR}imgui_impl_vulkan.h +${BACKENDS_DIR}imgui_impl_glfw.cpp ${BACKENDS_DIR}imgui_impl_glfw.h) + +if(WIN32) + file(GLOB IMGUI_WINDOWS_BACKEND_FILES true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/backends/ + ${BACKENDS_DIR}imgui_impl_dx11.cpp ${BACKENDS_DIR}imgui_impl_dx11.h + # ${BACKENDS_DIR}imgui_impl_dx12.cpp ${BACKENDS_DIR}imgui_impl_dx12.h + ${BACKENDS_DIR}imgui_impl_win32.cpp ${BACKENDS_DIR}imgui_impl_win32.h) + + list(APPEND IMGUI_BACKEND_FILES ${IMGUI_WINDOWS_BACKEND_FILES}) +endif() + +add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD) +include_directories(${DEPENDENCIES_DIR}GLAD/include) +include_directories(${DEPENDENCIES_DIR}GLFW/include) + +add_library(imgui STATIC ${IMGUI_FILES} ${IMGUI_BACKEND_FILES})