diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/hello-imgui | |
Diffstat (limited to 'vcpkg/ports/hello-imgui')
| -rw-r--r-- | vcpkg/ports/hello-imgui/cmake-config.diff | 30 | ||||
| -rw-r--r-- | vcpkg/ports/hello-imgui/imgui-test-engine.diff | 24 | ||||
| -rw-r--r-- | vcpkg/ports/hello-imgui/portfile.cmake | 112 | ||||
| -rw-r--r-- | vcpkg/ports/hello-imgui/support-imgui-1_91_9.patch | 49 | ||||
| -rw-r--r-- | vcpkg/ports/hello-imgui/usage | 8 | ||||
| -rw-r--r-- | vcpkg/ports/hello-imgui/vcpkg.json | 114 |
6 files changed, 337 insertions, 0 deletions
diff --git a/vcpkg/ports/hello-imgui/cmake-config.diff b/vcpkg/ports/hello-imgui/cmake-config.diff new file mode 100644 index 0000000..8f368c3 --- /dev/null +++ b/vcpkg/ports/hello-imgui/cmake-config.diff @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 26ae5f7..10a58fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -407,7 +407,8 @@ if(HELLOIMGUI_INSTALL) + VERSION ${hello_imgui_VERSION} + COMPATIBILITY AnyNewerVersion) + +- install(FILES "hello_imgui_cmake/hello-imguiConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/hello-imguiConfigVersion.cmake" ++ configure_file("${PROJECT_SOURCE_DIR}/hello_imgui_cmake/hello-imguiConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/hello-imguiConfig.cmake" @ONLY) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/hello-imguiConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/hello-imguiConfigVersion.cmake" + DESTINATION lib/cmake/hello_imgui) + endif() + +diff --git a/hello_imgui_cmake/hello-imguiConfig.cmake b/hello_imgui_cmake/hello-imguiConfig.cmake +index 2b93540..6cfa3f8 100644 +--- a/hello_imgui_cmake/hello-imguiConfig.cmake ++++ b/hello_imgui_cmake/hello-imguiConfig.cmake +@@ -1,6 +1,9 @@ + include(CMakeFindDependencyMacro) +-find_dependency(imgui CONFIG REQUIRED) +-find_dependency(glad CONFIG REQUIRED) ++find_dependency(imgui CONFIG) ++find_dependency(nlohmann_json CONFIG) ++if("@HELLOIMGUI_HAS_OPENGL3@") ++ find_dependency(glad CONFIG) ++endif() + + include(${CMAKE_CURRENT_LIST_DIR}/hello_imgui_cmake/hello_imgui_add_app.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/hello-imgui-targets.cmake) diff --git a/vcpkg/ports/hello-imgui/imgui-test-engine.diff b/vcpkg/ports/hello-imgui/imgui-test-engine.diff new file mode 100644 index 0000000..8cf35ef --- /dev/null +++ b/vcpkg/ports/hello-imgui/imgui-test-engine.diff @@ -0,0 +1,24 @@ +diff --git a/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake b/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake +index fda2d91..44c76a3 100644 +--- a/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake ++++ b/src/hello_imgui_test_engine_integration/hello_imgui_test_engine_cmake.cmake +@@ -147,9 +147,6 @@ endfunction() + + # Public API for this module + function(add_imgui_test_engine) +- _fetch_imgui_test_engine_if_needed() +- _add_imgui_test_engine_lib() +- _configure_imgui_with_test_engine() + _add_hello_imgui_test_engine_integration() + # _add_imgui_test_engine_app_minimal_example() + endfunction() +diff --git a/src/hello_imgui_test_engine_integration/test_engine_integration.cpp b/src/hello_imgui_test_engine_integration/test_engine_integration.cpp +index 9f5bb59..2be0fa1 100644 +--- a/src/hello_imgui_test_engine_integration/test_engine_integration.cpp ++++ b/src/hello_imgui_test_engine_integration/test_engine_integration.cpp +@@ -1,4 +1,4 @@ +-#include "imgui_test_engine/imgui_te_engine.h" ++#include <imgui_te_engine.h> + #include "hello_imgui/runner_params.h" + #include "hello_imgui/internal/functional_utils.h" + #include "hello_imgui/internal/backend_impls/opengl_setup_helper/opengl_screenshot.h" diff --git a/vcpkg/ports/hello-imgui/portfile.cmake b/vcpkg/ports/hello-imgui/portfile.cmake new file mode 100644 index 0000000..073f3ea --- /dev/null +++ b/vcpkg/ports/hello-imgui/portfile.cmake @@ -0,0 +1,112 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # this mirrors ImGui's portfile behavior + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO pthom/hello_imgui + REF "v${VERSION}" + SHA512 b44741e27278974f6a545a3143abd18027d98503cc912085e08528c467197fb208d2d4876e483f74e518f3dfc14d12c3579e379b9939dc364a1fff4ee98bb8f5 + HEAD_REF master + PATCHES + cmake-config.diff + imgui-test-engine.diff + # PR has been merged into https://github.com/pthom/hello_imgui/pull/142. This patch should not be needed in the next release. + support-imgui-1_91_9.patch +) +file(REMOVE_RECURSE + "${SOURCE_PATH}/external/imgui" + "${SOURCE_PATH}/external/nlohmann_json" + "${SOURCE_PATH}/external/OpenGL_Loaders" + "${SOURCE_PATH}/external/stb_hello_imgui/stb_image.h" + "${SOURCE_PATH}/external/stb_hello_imgui/stb_image_write.h" +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + # "target platforms" + opengl3-binding HELLOIMGUI_HAS_OPENGL3 + metal-binding HELLOIMGUI_HAS_METAL + experimental-vulkan-binding HELLOIMGUI_HAS_VULKAN + experimental-dx11-binding HELLOIMGUI_HAS_DIRECTX11 + experimental-dx12-binding HELLOIMGUI_HAS_DIRECTX12 + # "platform backends" + glfw-binding HELLOIMGUI_USE_GLFW3 + # sdl2-binding HELLOIMGUI_USE_SDL2 # removed with imgui[sdl2-binding] + # other + test-engine HELLOIMGUI_WITH_TEST_ENGINE +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + -DHELLO_IMGUI_IMGUI_SHARED=OFF + -DHELLOIMGUI_BUILD_DEMOS=OFF + -DHELLOIMGUI_BUILD_IMGUI=OFF + -DHELLOIMGUI_FETCH_FORBIDDEN=ON + -DHELLOIMGUI_FREETYPE_STATIC=OFF + -DHELLOIMGUI_MACOS_NO_BUNDLE=OFF + -DHELLOIMGUI_USE_IMGUI_CMAKE_PACKAGE=ON + -DHELLOIMGUI_WIN32_NO_CONSOLE=ON + -DHELLOIMGUI_WIN32_AUTO_WINMAIN=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_glad=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json=ON + MAYBE_UNUSED_VARIABLES + CMAKE_REQUIRE_FIND_PACKAGE_glad + HELLOIMGUI_WIN32_NO_CONSOLE +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/hello_imgui" PACKAGE_NAME "hello-imgui") + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/hello-imgui/hello_imgui_cmake/ios-cmake" +) + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +if (NOT HELLOIMGUI_HAS_OPENGL3 + AND NOT HELLOIMGUI_HAS_METAL + AND NOT HELLOIMGUI_HAS_VULKAN + AND NOT HELLOIMGUI_HAS_DIRECTX11 + AND NOT HELLOIMGUI_HAS_DIRECTX12) + set(no_rendering_backend TRUE) +endif() +if (NOT HELLOIMGUI_USE_GLFW3 + AND NOT HELLOIMGUI_USE_SDL2) + set(no_platform_backend TRUE) +endif() +if (no_rendering_backend OR no_platform_backend) + file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" " + ######################################################################## + !!!! WARNING !!!!! + !!!! Installed hello-imgui without a viable backend !!!!! + ######################################################################## + + When installing hello-imgui, you should specify: + + - At least one (or more) rendering backend (OpenGL3, Metal, Vulkan, DirectX11, DirectX12) + Make your choice according to your needs and your target platforms, between: + opengl3-binding # This is the recommended choice, especially for beginners + metal-binding # Apple only, advanced users only + experimental-vulkan-binding # Advanced users only + experimental-dx11-binding # Windows only, still experimental + experimental-dx12-binding # Windows only, advanced users only, still experimental + + - At least one (or more) platform backend (Glfw3*): + Make your choice according to your needs and your target platforms, between: + glfw-binding + *) This port currently doesn't offer an SDL platform backend. + + For example, you could use: + vcpkg install \"hello-imgui[opengl3-binding,glfw-binding]\" + + ######################################################################## + !!!! WARNING !!!!! + !!!! Installed hello-imgui without a viable backend !!!!! + ######################################################################## + ") +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/hello-imgui/support-imgui-1_91_9.patch b/vcpkg/ports/hello-imgui/support-imgui-1_91_9.patch new file mode 100644 index 0000000..185e60a --- /dev/null +++ b/vcpkg/ports/hello-imgui/support-imgui-1_91_9.patch @@ -0,0 +1,49 @@ +diff --git a/src/hello_imgui/impl/imgui_theme.cpp b/src/hello_imgui/impl/imgui_theme.cpp +index 8bc60cb..87f2de4 100644 +--- a/src/hello_imgui/impl/imgui_theme.cpp ++++ b/src/hello_imgui/impl/imgui_theme.cpp +@@ -314,7 +314,7 @@ namespace ImGuiTheme + style.GrabRounding = 0.0f; + style.TabRounding = 0.0f; + style.TabBorderSize = 0.0f; +- style.TabMinWidthForCloseButton = 0.0f; ++ style.TabCloseButtonMinWidthUnselected = 0.0f; + style.ColorButtonPosition = ImGuiDir_Left; + style.ButtonTextAlign = ImVec2(0.5f, 0.5f); + style.SelectableTextAlign = ImVec2(0.0f, 0.0f); +@@ -408,7 +408,7 @@ namespace ImGuiTheme + style.GrabRounding = 0.0f; + style.TabRounding = 0.0f; + style.TabBorderSize = 1.0f; +- style.TabMinWidthForCloseButton = 0.0f; ++ style.TabCloseButtonMinWidthUnselected = 0.0f; + style.ColorButtonPosition = ImGuiDir_Right; + style.ButtonTextAlign = ImVec2(0.5f, 0.5f); + style.SelectableTextAlign = ImVec2(0.0f, 0.0f); +@@ -577,7 +577,7 @@ namespace ImGuiTheme + style.GrabRounding = 0.0f; + style.TabRounding = 4.0f; + style.TabBorderSize = 0.0f; +- style.TabMinWidthForCloseButton = 0.0f; ++ style.TabCloseButtonMinWidthUnselected = 0.0f; + style.ColorButtonPosition = ImGuiDir_Right; + style.ButtonTextAlign = ImVec2(0.5f, 0.5f); + style.SelectableTextAlign = ImVec2(0.0f, 0.0f); +@@ -615,7 +615,7 @@ namespace ImGuiTheme + style.GrabRounding = 2.0f; + style.TabRounding = 4.0f; + style.TabBorderSize = 1.0f; +- style.TabMinWidthForCloseButton = 0.0f; ++ style.TabCloseButtonMinWidthUnselected = 0.0f; + style.ColorButtonPosition = ImGuiDir_Right; + style.ButtonTextAlign = ImVec2(0.5f, 0.5f); + style.SelectableTextAlign = ImVec2(0.0f, 0.0f); +@@ -814,7 +814,7 @@ namespace ImGuiTheme + style.ScrollbarSize = 15.5f; + style.GrabMinSize = 10.89999961853027f; + style.TabBorderSize = 1.0f; +- style.TabMinWidthForCloseButton = 0.0f; ++ style.TabCloseButtonMinWidthUnselected = 0.0f; + style.ColorButtonPosition = ImGuiDir_Right; + style.ButtonTextAlign = ImVec2(0.5f, 0.5f); + style.SelectableTextAlign = ImVec2(0.0f, 0.5f); diff --git a/vcpkg/ports/hello-imgui/usage b/vcpkg/ports/hello-imgui/usage new file mode 100644 index 0000000..7c1cb1c --- /dev/null +++ b/vcpkg/ports/hello-imgui/usage @@ -0,0 +1,8 @@ +hello-imgui provides CMake integration: + + set(CMAKE_CXX_STANDARD 17) + find_package(hello-imgui CONFIG REQUIRED) + # Usage with `hello_imgui_add_app` (recommended) + hello_imgui_add_app(main my_main.cpp) + # Usage with `target_link_libraries` (no tooling, no asset deployment) + target_link_libraries(main PRIVATE hello-imgui::hello_imgui) diff --git a/vcpkg/ports/hello-imgui/vcpkg.json b/vcpkg/ports/hello-imgui/vcpkg.json new file mode 100644 index 0000000..6e1f67a --- /dev/null +++ b/vcpkg/ports/hello-imgui/vcpkg.json @@ -0,0 +1,114 @@ +{ + "name": "hello-imgui", + "version": "1.6.0", + "port-version": 3, + "description": [ + "Hello ImGui: unleash your creativity in app development and prototyping", + "Note that at least on renderer backend and at least one platform backend must be chosen." + ], + "homepage": "https://pthom.github.io/hello_imgui/", + "license": "MIT", + "dependencies": [ + { + "name": "imgui", + "features": [ + "docking-experimental" + ] + }, + "nlohmann-json", + "stb", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "experimental-dx11-binding": { + "description": "Use DirectX11 renderer backend (Windows only, experimental)", + "dependencies": [ + { + "name": "imgui", + "features": [ + "dx11-binding" + ] + } + ] + }, + "experimental-dx12-binding": { + "description": "Use DirectX12 renderer backend (Windows only, experimental)", + "dependencies": [ + { + "name": "imgui", + "features": [ + "dx12-binding" + ] + } + ] + }, + "experimental-vulkan-binding": { + "description": "Use Vulkan renderer backend (Windows/Linux/macOS, experimental)", + "dependencies": [ + { + "name": "imgui", + "features": [ + "vulkan-binding" + ] + } + ] + }, + "glfw-binding": { + "description": "Use GLFW platform backend (default)", + "dependencies": [ + { + "name": "imgui", + "features": [ + "glfw-binding" + ] + } + ] + }, + "metal-binding": { + "description": "Use Metal renderer backend (macOS/iOS only)", + "dependencies": [ + { + "name": "imgui", + "features": [ + "metal-binding" + ] + } + ] + }, + "opengl3-binding": { + "description": "Use OpenGL3/ES2 renderer backend (default)", + "dependencies": [ + { + "name": "glad", + "features": [ + "gl-api-43" + ] + }, + { + "name": "imgui", + "features": [ + "opengl3-binding" + ] + } + ] + }, + "test-engine": { + "description": "Build test engine", + "dependencies": [ + { + "name": "imgui", + "features": [ + "test-engine" + ] + } + ] + } + } +} |