diff --git a/ports/imgui/CMakeLists.txt b/ports/imgui/CMakeLists.txt index 4a2ce76280e8a5..236201f2edf4fb 100644 --- a/ports/imgui/CMakeLists.txt +++ b/ports/imgui/CMakeLists.txt @@ -19,13 +19,38 @@ set(IMGUI_SOURCES imgui_widgets.cpp ) +if (IMGUI_INCLUDE_IMPL_VULKAN) + find_package(vulkan REQUIRED) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_vulkan.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_vulkan.cpp) +endif() + +if (IMGUI_INCLUDE_IMPL_SDL2) + find_package(SDL2 CONFIG REQUIRED) + + list (APPEND IMGUI_INCLUDES_PUBLIC examples/imgui_impl_sdl.h) + list (APPEND IMGUI_SOURCES examples/imgui_impl_sdl.cpp) +endif() + + add_library(${PROJECT_NAME} ${IMGUI_INCLUDES_PUBLIC} ${IMGUI_INCLUDES_PRIVATE} ${IMGUI_SOURCES} ) -target_include_directories(${PROJECT_NAME} PUBLIC $) +if (IMGUI_INCLUDE_IMPL_VULKAN) + target_link_libraries(${PROJECT_NAME} PUBLIC Vulkan::Vulkan) +endif() + +if (IMGUI_INCLUDE_IMPL_SDL2) + target_link_libraries(${PROJECT_NAME} PUBLIC SDL2::SDL2main SDL2::SDL2-static) +endif() + +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $) install(TARGETS ${PROJECT_NAME} EXPORT IMGUIExport diff --git a/ports/imgui/CONTROL b/ports/imgui/CONTROL index 6484a925ac79d1..5c3591768ea429 100644 --- a/ports/imgui/CONTROL +++ b/ports/imgui/CONTROL @@ -1,8 +1,16 @@ Source: imgui -Version: 1.73-1 +Version: 1.74 Homepage: https://github.com/ocornut/imgui Description: Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies. +Feature: vulkan +Description: imgui developer renderer bindings implementation for vulkan +Build-Depends: vulkan + +Feature: sdl2 +Description: imgui developer platform bindings implementation for sdl2 +Build-Depends: sdl2 + Feature: example -Description: build with examples +Description: build with all examples Build-Depends: glfw3, freeglut, opengl, sdl1 diff --git a/ports/imgui/portfile.cmake b/ports/imgui/portfile.cmake index 62d674353859ac..674330b380117a 100644 --- a/ports/imgui/portfile.cmake +++ b/ports/imgui/portfile.cmake @@ -5,16 +5,28 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ocornut/imgui - REF v1.73 - SHA512 1d67b7cc3f06ea77a2484e62034104386f42106fefe9b6eb62ee8a31fe949c9cda0cc095fbead9269e9da2a5d6199604d34c095eefd630655725265ac0fc4d92 + REF v1.74 + SHA512 e49e5cbe55899c0d0abc9b66c4e6e3e9941542af542d0ed3304bd3bde34c769baa2367355b77b91acb7fca56f9bcfd233dfc99881cfc8f5f6a2e2e6839990832 HEAD_REF master ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + vulkan IMGUI_INCLUDE_IMPL_VULKAN + sdl2 IMGUI_INCLUDE_IMPL_SDL2 + example IMGUI_COMPILE_ALL_EXAMPLES +) + +if ("example" IN_LIST FEATURES AND ("sdl2" IN_LIST FEATURES OR "vulkan" IN_LIST FEATURES)) + message (FATAL_ERROR "example feature uses includes whole examples folder, do not use it with other features") +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DIMGUI_SKIP_HEADERS=ON ) @@ -29,11 +41,11 @@ if ("example" IN_LIST FEATURES) USE_VCPKG_INTEGRATION PROJECT_PATH ${SOURCE_PATH}/examples/imgui_examples.sln ) - + # Install headers file(GLOB IMGUI_EXAMPLE_INCLUDES ${SOURCE_PATH}/examples/*.h) file(INSTALL ${IMGUI_EXAMPLE_INCLUDES} DESTINATION ${CURRENT_PACKAGES_DIR}/include) - + # Install tools file(GLOB_RECURSE IMGUI_EXAMPLE_BINARIES ${SOURCE_PATH}/examples/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}) file(INSTALL ${IMGUI_EXAMPLE_BINARIES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)