From f1ea24397b2de8da8b0248eaa0ba59c808e1d3e1 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 8 Mar 2025 06:43:15 +0100 Subject: [PATCH 01/10] [hello-imgui] Do not use svg in names --- ports/hello-imgui/portfile.cmake | 2 +- ports/hello-imgui/vcpkg.json | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index 0bf1766d0ef434..db1a1517858726 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -16,7 +16,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "experimental-dx11-binding" HELLOIMGUI_HAS_DIRECTX11 "experimental-dx12-binding" HELLOIMGUI_HAS_DIRECTX12 "glfw-binding" HELLOIMGUI_USE_GLFW3 - "freetype-plutosvg" HELLOIMGUI_USE_FREETYPE # When hello_imgui is built with freetype, it will also build with plutosvg + "freetype" HELLOIMGUI_USE_FREETYPE ) if (NOT HELLOIMGUI_HAS_OPENGL3 diff --git a/ports/hello-imgui/vcpkg.json b/ports/hello-imgui/vcpkg.json index 998d3cd1547f24..9d9a73aa8e0c48 100644 --- a/ports/hello-imgui/vcpkg.json +++ b/ports/hello-imgui/vcpkg.json @@ -1,7 +1,7 @@ { "name": "hello-imgui", "version": "1.6.0", - "port-version": 1, + "port-version": 2, "description": "Hello ImGui: unleash your creativity in app development and prototyping", "homepage": "https://pthom.github.io/hello_imgui/", "license": "MIT", @@ -56,14 +56,13 @@ } ] }, - "freetype-plutosvg": { - "description": "Improve font rendering and use colored fonts with freetype and plutosvg", + "freetype": { + "description": "Use freetype for text rendering", "dependencies": [ { "name": "imgui", "features": [ - "freetype", - "freetype-svg" + "freetype" ] } ] From c331009577b302cb645941dfbb18be95e3a4d512 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 8 Mar 2025 06:53:27 +0100 Subject: [PATCH 02/10] [vcpkg-ci-hello-imgui] New test port --- .../vcpkg-ci-hello-imgui/portfile.cmake | 6 ++++ .../project/CMakeLists.txt | 11 +++++++ .../vcpkg-ci-hello-imgui/project/main.cpp | 10 ++++++ .../vcpkg-ci-hello-imgui/vcpkg.json | 32 +++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 scripts/test_ports/vcpkg-ci-hello-imgui/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-hello-imgui/project/CMakeLists.txt create mode 100644 scripts/test_ports/vcpkg-ci-hello-imgui/project/main.cpp create mode 100644 scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/portfile.cmake b/scripts/test_ports/vcpkg-ci-hello-imgui/portfile.cmake new file mode 100644 index 00000000000000..d1ab44ac5a76c1 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/portfile.cmake @@ -0,0 +1,6 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" +) +vcpkg_cmake_build() diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-hello-imgui/project/CMakeLists.txt new file mode 100644 index 00000000000000..4d03bc682211e5 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/project/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.30) +project(hello-imgui-test CXX) + +set(CMAKE_CXX_STANDARD 17) + +find_package(hello-imgui CONFIG REQUIRED) + +add_executable(main main.cpp) +target_link_libraries(main PRIVATE + hello-imgui::hello_imgui +) diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/project/main.cpp b/scripts/test_ports/vcpkg-ci-hello-imgui/project/main.cpp new file mode 100644 index 00000000000000..12433aa598b760 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/project/main.cpp @@ -0,0 +1,10 @@ +#include + +int main() +{ + HelloImGui::Run([]() { + ImGui::Text("Hello vcpkg"); + ImGui::ShowDemoWindow(); + }); + return 0; +} diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json new file mode 100644 index 00000000000000..975ba6ee599399 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json @@ -0,0 +1,32 @@ +{ + "name": "vcpkg-ci-hello-imgui", + "version-string": "ci", + "description": "Port to force features of hello-imgui within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "hello-imgui", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } + ], + "default-features": [ + "all" + ], + "features": { + "all": { + "description": "Test all features", + "dependencies": [ + { + "name": "hello-imgui", + "features": [ + ] + } + ] + } + } +} From d9fcca37650d47e829009a4cf18eebfe6e4772df Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 8 Mar 2025 07:08:36 +0100 Subject: [PATCH 03/10] Remove vendored dependencies --- ports/hello-imgui/portfile.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index db1a1517858726..ced6dc9fcedb53 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -7,6 +7,13 @@ vcpkg_from_github( SHA512 b44741e27278974f6a545a3143abd18027d98503cc912085e08528c467197fb208d2d4876e483f74e518f3dfc14d12c3579e379b9939dc364a1fff4ee98bb8f5 HEAD_REF master ) +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 FEATURE_OPTIONS FEATURES From 21accbd5b7e022964fd55f86c609ebd686e680d6 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 8 Mar 2025 07:23:39 +0100 Subject: [PATCH 04/10] Fix cmake config --- ports/hello-imgui/cmake-config.diff | 30 +++++++++++++++++++++++++++++ ports/hello-imgui/portfile.cmake | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 ports/hello-imgui/cmake-config.diff diff --git a/ports/hello-imgui/cmake-config.diff b/ports/hello-imgui/cmake-config.diff new file mode 100644 index 00000000000000..8f368c3d836265 --- /dev/null +++ b/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/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index ced6dc9fcedb53..655a0b686732cf 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF "v${VERSION}" SHA512 b44741e27278974f6a545a3143abd18027d98503cc912085e08528c467197fb208d2d4876e483f74e518f3dfc14d12c3579e379b9939dc364a1fff4ee98bb8f5 HEAD_REF master + PATCHES + cmake-config.diff ) file(REMOVE_RECURSE "${SOURCE_PATH}/external/imgui" From 0ba5045240452859fa6d262c09369ab9f6d94839 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 8 Mar 2025 07:50:23 +0100 Subject: [PATCH 05/10] Test features [skip actions] --- .../vcpkg-ci-hello-imgui/vcpkg.json | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json index 975ba6ee599399..58f9a0e59d9471 100644 --- a/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json @@ -24,7 +24,50 @@ { "name": "hello-imgui", "features": [ - ] + "freetype", + "glfw-binding", + "opengl3-binding" + ], + "platform": "linux" + }, + { + "name": "hello-imgui", + "features": [ + "freetype", + "opengl3-binding" + ], + "platform": "android" + }, + { + "name": "hello-imgui", + "features": [ + "metal-binding" + ], + "platform": "ios | osx" + }, + { + "name": "hello-imgui", + "features": [ + "freetype", + "opengl3-binding" + ], + "platform": "x64 & windows" + }, + { + "name": "hello-imgui", + "features": [ + "experimental-dx11-binding", + "freetype" + ], + "platform": "x86 & windows" + }, + { + "name": "hello-imgui", + "features": [ + "experimental-vulkan-binding", + "freetype" + ], + "platform": "arm64 & windows" } ] } From 2b8403ab530c3f67416b5ac200bea5437f439847 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 9 Mar 2025 15:22:58 +0100 Subject: [PATCH 06/10] Rewire feature options Plug in HELLOIMGUI_USE_FREETYPE. --- ports/hello-imgui/portfile.cmake | 38 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index 655a0b686732cf..8931317972385a 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -17,15 +17,18 @@ file(REMOVE_RECURSE "${SOURCE_PATH}/external/stb_hello_imgui/stb_image_write.h" ) -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +vcpkg_check_features(OUT_FEATURE_OPTIONS options FEATURES - "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 - "glfw-binding" HELLOIMGUI_USE_GLFW3 - "freetype" HELLOIMGUI_USE_FREETYPE + # "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 backend" + glfw-binding HELLOIMGUI_USE_GLFW3 + # other + freetype HELLOIMGUI_USE_FREETYPE ) if (NOT HELLOIMGUI_HAS_OPENGL3 @@ -41,11 +44,10 @@ if (NOT HELLOIMGUI_USE_GLFW3 AND NOT HELLOIMGUI_USE_SDL2) endif() -set(platform_options "") if(VCPKG_TARGET_IS_WINDOWS) # Standard win32 options (these are the defaults for HelloImGui) # we could add a vcpkg feature for this, but it would have to be platform specific - list(APPEND platform_options + list(APPEND options -DHELLOIMGUI_WIN32_NO_CONSOLE=ON -DHELLOIMGUI_WIN32_AUTO_WINMAIN=ON ) @@ -54,7 +56,7 @@ endif() if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) # Standard macOS options (these are the defaults for HelloImGui) # we could add a vcpkg feature for this, but it would have to be platform specific - list(APPEND platform_options + list(APPEND options -DHELLOIMGUI_MACOS_NO_BUNDLE=OFF ) endif() @@ -63,6 +65,7 @@ endif() vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + ${options} -DHELLOIMGUI_BUILD_DEMOS=OFF -DHELLOIMGUI_BUILD_DOCS=OFF -DHELLOIMGUI_BUILD_TESTS=OFF @@ -73,19 +76,6 @@ vcpkg_cmake_configure( -DHELLOIMGUI_USE_IMGUI_CMAKE_PACKAGE=ON -DHELLO_IMGUI_IMGUI_SHARED=OFF -DHELLOIMGUI_BUILD_IMGUI=OFF - - ${platform_options} - - # Rendering backends - -DHELLOIMGUI_HAS_OPENGL3=${HELLOIMGUI_HAS_OPENGL3} - -DHELLOIMGUI_HAS_METAL=${HELLOIMGUI_HAS_METAL} - -DHELLOIMGUI_HAS_VULKAN=${HELLOIMGUI_HAS_VULKAN} - -DHELLOIMGUI_HAS_DIRECTX11=${HELLOIMGUI_HAS_DIRECTX11} - -DHELLOIMGUI_HAS_DIRECTX12=${HELLOIMGUI_HAS_DIRECTX12} - - # Platform backends - -DHELLOIMGUI_USE_GLFW3=${HELLOIMGUI_USE_GLFW3} - -DHELLOIMGUI_USE_SDL2=${HELLOIMGUI_USE_SDL2} ) vcpkg_cmake_install() From 8a3a852c37e710725d58630b9c6a0ca2a39fa5f9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 9 Mar 2025 15:30:30 +0100 Subject: [PATCH 07/10] Add nlohmann-json dependency --- ports/hello-imgui/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/hello-imgui/vcpkg.json b/ports/hello-imgui/vcpkg.json index 9d9a73aa8e0c48..b93778efb2c9ae 100644 --- a/ports/hello-imgui/vcpkg.json +++ b/ports/hello-imgui/vcpkg.json @@ -12,6 +12,7 @@ "docking-experimental" ] }, + "nlohmann-json", "stb", { "name": "vcpkg-cmake", From 36d38d77b83b214d29125a91b547397c59019030 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 9 Mar 2025 15:37:23 +0100 Subject: [PATCH 08/10] Revise usage --- ports/hello-imgui/portfile.cmake | 6 +++--- ports/hello-imgui/usage | 23 +++++++---------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index 8931317972385a..e55b05c477ffe3 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -88,11 +88,9 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/hello-imgui/hello_imgui_cmake/ios-cmake" ) -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") - if (no_rendering_backend OR no_platform_backend) - message(STATUS " + file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" " ######################################################################## !!!! WARNING !!!!! !!!! Installed hello-imgui without a viable backend !!!!! @@ -122,3 +120,5 @@ if (no_rendering_backend OR no_platform_backend) ######################################################################## ") endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/hello-imgui/usage b/ports/hello-imgui/usage index a4b8a172709380..168c95e28baa44 100644 --- a/ports/hello-imgui/usage +++ b/ports/hello-imgui/usage @@ -1,17 +1,8 @@ -hello_imgui provides CMake targets and hello_imgui_add_app: +hello_imgui provides CMake integration: -Usage with `hello_imgui_add_app` (recommended) - set(CMAKE_CXX_STANDARD 17) - find_package(hello-imgui CONFIG REQUIRED) - hello_imgui_add_app(test test.cpp) # see example below - -Usage with `target_link_libraries` - set(CMAKE_CXX_STANDARD 17) - find_package(hello-imgui CONFIG REQUIRED) - # Note the subtle difference between the package name and the target name: hello-imgui vs hello_imgui! - target_link_libraries(main PRIVATE hello-imgui::hello_imgui) - # this mode will ignore all of hello_imgui cmake tooling, and will not deploy the assets - -Example test.cpp: - #include "hello_imgui/hello_imgui.h" - int main() { HelloImGui::Run([](){ ImGui::Text("Hello, world!"); ImGui::ShowDemoWindow(); }); } + 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 and asset deployment) + target_link_libraries(main PRIVATE hello-imgui::hello_imgui) From 763e3a9495ede576f99aff35d0d55274e9c6e8c8 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 9 Mar 2025 15:38:03 +0100 Subject: [PATCH 09/10] versions --- versions/baseline.json | 2 +- versions/h-/hello-imgui.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 5ed690f82b69a8..a72bfcd6d9a025 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3538,7 +3538,7 @@ }, "hello-imgui": { "baseline": "1.6.0", - "port-version": 1 + "port-version": 2 }, "hexl": { "baseline": "1.2.5", diff --git a/versions/h-/hello-imgui.json b/versions/h-/hello-imgui.json index 050f4ed77fda88..dadf4bd06b5070 100644 --- a/versions/h-/hello-imgui.json +++ b/versions/h-/hello-imgui.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d5ca2e9e5bc11096b64d6db8097f526b1d9acb6c", + "version": "1.6.0", + "port-version": 2 + }, { "git-tree": "ad86a79efe058977548ffde34179005239f78266", "version": "1.6.0", From 91dfd8fdc4da442c1dc6cfd410eaf647f4fb43bb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 9 Mar 2025 18:29:07 +0100 Subject: [PATCH 10/10] More changes --- ports/hello-imgui/imgui-test-engine.diff | 24 ++++++ ports/hello-imgui/portfile.cmake | 76 ++++++++----------- ports/hello-imgui/usage | 4 +- ports/hello-imgui/vcpkg.json | 27 ++++--- .../vcpkg-ci-hello-imgui/vcpkg.json | 14 ++-- versions/h-/hello-imgui.json | 2 +- 6 files changed, 81 insertions(+), 66 deletions(-) create mode 100644 ports/hello-imgui/imgui-test-engine.diff diff --git a/ports/hello-imgui/imgui-test-engine.diff b/ports/hello-imgui/imgui-test-engine.diff new file mode 100644 index 00000000000000..8cf35ef1ee7b0c --- /dev/null +++ b/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 + #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/ports/hello-imgui/portfile.cmake b/ports/hello-imgui/portfile.cmake index e55b05c477ffe3..1d69cf79c1ac6e 100644 --- a/ports/hello-imgui/portfile.cmake +++ b/ports/hello-imgui/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES cmake-config.diff + imgui-test-engine.diff ) file(REMOVE_RECURSE "${SOURCE_PATH}/external/imgui" @@ -25,62 +26,36 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS options experimental-vulkan-binding HELLOIMGUI_HAS_VULKAN experimental-dx11-binding HELLOIMGUI_HAS_DIRECTX11 experimental-dx12-binding HELLOIMGUI_HAS_DIRECTX12 - # "platform backend" + # "platform backends" glfw-binding HELLOIMGUI_USE_GLFW3 + # sdl2-binding HELLOIMGUI_USE_SDL2 # removed with imgui[sdl2-binding] # other - freetype HELLOIMGUI_USE_FREETYPE + test-engine HELLOIMGUI_WITH_TEST_ENGINE ) -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 ON) -endif() - -if (NOT HELLOIMGUI_USE_GLFW3 AND NOT HELLOIMGUI_USE_SDL2) - set(no_platform_backend ON) -endif() - - -if(VCPKG_TARGET_IS_WINDOWS) - # Standard win32 options (these are the defaults for HelloImGui) - # we could add a vcpkg feature for this, but it would have to be platform specific - list(APPEND options - -DHELLOIMGUI_WIN32_NO_CONSOLE=ON - -DHELLOIMGUI_WIN32_AUTO_WINMAIN=ON - ) -endif() - -if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) - # Standard macOS options (these are the defaults for HelloImGui) - # we could add a vcpkg feature for this, but it would have to be platform specific - list(APPEND options - -DHELLOIMGUI_MACOS_NO_BUNDLE=OFF - ) -endif() - - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS ${options} - -DHELLOIMGUI_BUILD_DEMOS=OFF - -DHELLOIMGUI_BUILD_DOCS=OFF - -DHELLOIMGUI_BUILD_TESTS=OFF - - # vcpkg does not support ImGui Test Engine, so we cannot enable it - -DHELLOIMGUI_WITH_TEST_ENGINE=OFF - - -DHELLOIMGUI_USE_IMGUI_CMAKE_PACKAGE=ON -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") # should be active once himgui produces a config +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/hello_imgui" PACKAGE_NAME "hello-imgui") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" @@ -89,6 +64,17 @@ file(REMOVE_RECURSE ) 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" " ######################################################################## @@ -106,10 +92,10 @@ if (no_rendering_backend OR no_platform_backend) experimental-dx11-binding # Windows only, still experimental experimental-dx12-binding # Windows only, advanced users only, still experimental - - At least one (or more) platform backend (SDL2, Glfw3): - Make your choice according to your needs and your target platforms, between: + - At least one (or more) platform backend (Glfw3*): + Make your choice according to your needs and your target platforms, between: glfw-binding - sdl-binding + *) This port currently doesn't offer an SDL platform backend. For example, you could use: vcpkg install \"hello-imgui[opengl3-binding,glfw-binding]\" diff --git a/ports/hello-imgui/usage b/ports/hello-imgui/usage index 168c95e28baa44..7c1cb1ce5b4353 100644 --- a/ports/hello-imgui/usage +++ b/ports/hello-imgui/usage @@ -1,8 +1,8 @@ -hello_imgui provides CMake integration: +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 and asset deployment) + # Usage with `target_link_libraries` (no tooling, no asset deployment) target_link_libraries(main PRIVATE hello-imgui::hello_imgui) diff --git a/ports/hello-imgui/vcpkg.json b/ports/hello-imgui/vcpkg.json index b93778efb2c9ae..9939a23e2412e2 100644 --- a/ports/hello-imgui/vcpkg.json +++ b/ports/hello-imgui/vcpkg.json @@ -2,7 +2,10 @@ "name": "hello-imgui", "version": "1.6.0", "port-version": 2, - "description": "Hello ImGui: unleash your creativity in app development and prototyping", + "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": [ @@ -57,17 +60,6 @@ } ] }, - "freetype": { - "description": "Use freetype for text rendering", - "dependencies": [ - { - "name": "imgui", - "features": [ - "freetype" - ] - } - ] - }, "glfw-binding": { "description": "Use GLFW platform backend (default)", "dependencies": [ @@ -106,6 +98,17 @@ ] } ] + }, + "test-engine": { + "description": "Build test engine", + "dependencies": [ + { + "name": "imgui", + "features": [ + "test-engine" + ] + } + ] } } } diff --git a/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json index 58f9a0e59d9471..a74ede44a78c91 100644 --- a/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json +++ b/scripts/test_ports/vcpkg-ci-hello-imgui/vcpkg.json @@ -24,16 +24,16 @@ { "name": "hello-imgui", "features": [ - "freetype", "glfw-binding", - "opengl3-binding" + "opengl3-binding", + "test-engine" ], "platform": "linux" }, { + "$comment": "No platform backend available since removal of imgui[sdl2-binding]", "name": "hello-imgui", "features": [ - "freetype", "opengl3-binding" ], "platform": "android" @@ -41,6 +41,7 @@ { "name": "hello-imgui", "features": [ + "glfw-binding", "metal-binding" ], "platform": "ios | osx" @@ -48,7 +49,7 @@ { "name": "hello-imgui", "features": [ - "freetype", + "glfw-binding", "opengl3-binding" ], "platform": "x64 & windows" @@ -57,7 +58,7 @@ "name": "hello-imgui", "features": [ "experimental-dx11-binding", - "freetype" + "glfw-binding" ], "platform": "x86 & windows" }, @@ -65,7 +66,8 @@ "name": "hello-imgui", "features": [ "experimental-vulkan-binding", - "freetype" + "glfw-binding", + "test-engine" ], "platform": "arm64 & windows" } diff --git a/versions/h-/hello-imgui.json b/versions/h-/hello-imgui.json index dadf4bd06b5070..96beeccf44d20a 100644 --- a/versions/h-/hello-imgui.json +++ b/versions/h-/hello-imgui.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d5ca2e9e5bc11096b64d6db8097f526b1d9acb6c", + "git-tree": "7b5fb698a8594d93f40dc96edbbce679a852c1bf", "version": "1.6.0", "port-version": 2 },