set(IMGUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
file(GLOB IMGUI_CORE_SOURCE "${IMGUI_DIR}/*.cpp")
file(GLOB IMGUI_CORE_HEADERS "${IMGUI_DIR}/*.h")
file(GLOB IMGUI_STDLIB "${IMGUI_DIR}/misc/cpp/imgui_stdlib.*")
file(GLOB IMGUI_GLFW_BACKEND "${IMGUI_DIR}/backends/imgui_impl_glfw.*")
file(GLOB IMGUI_OPENGL3_BACKEND "${IMGUI_DIR}/backends/imgui_impl_opengl3.*")
file(GLOB IMGUI_VULKAN_BACKEND "${IMGUI_DIR}/backends/imgui_impl_vulkan.*")
set(IMGUI_MANIFEST ${IMGUI_CORE_SOURCE} ${IMGUI_CORE_HEADERS} ${IMGUI_STDLIB} ${IMGUI_GLFW_BACKEND} ${IMGUI_OPENGL3_BACKEND} ${IMGUI_VULKAN_BACKEND})
add_library(imgui STATIC ${IMGUI_MANIFEST})
target_include_directories(imgui PUBLIC ${IMGUI_DIR} ${Vulkan_INCLUDE_DIR})
target_link_libraries(imgui PUBLIC glfw glad ${Vulkan_LIBRARIES})
target_compile_definitions(imgui PUBLIC IMGUI_IMPL_OPENGL_LOADER_GLAD)
set_target_properties(imgui PROPERTIES CXX_STANDARD 17)