diff options
| author | kiwixz <kiwixz@outlook.com> | 2019-09-10 22:52:21 +0200 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-09-10 13:52:21 -0700 |
| commit | 95a336e0495d31bbe899b3178822df9cacf94b97 (patch) | |
| tree | 5041f97ef1b5be49e788e2f5cb5cdf9a970d9c75 | |
| parent | 15d747662c1e35e5229b3f444b3ef6a12ada0fd6 (diff) | |
| download | vcpkg-95a336e0495d31bbe899b3178822df9cacf94b97.tar.gz vcpkg-95a336e0495d31bbe899b3178822df9cacf94b97.zip | |
[imgui-sfml] update to 2.1 (#8004)
| -rw-r--r-- | ports/imgui-sfml/0001-fix_find_package.patch | 50 | ||||
| -rw-r--r-- | ports/imgui-sfml/0002-fix_imgui_config.patch | 11 | ||||
| -rw-r--r-- | ports/imgui-sfml/0003-fix_osx.patch (renamed from ports/imgui-sfml/remove-delegating-ctor.patch) | 2 | ||||
| -rw-r--r-- | ports/imgui-sfml/CONTROL | 4 | ||||
| -rw-r--r-- | ports/imgui-sfml/portfile.cmake | 20 | ||||
| -rw-r--r-- | ports/imgui-sfml/static-build-with-vcpkg-imgui.patch | 71 | ||||
| -rw-r--r-- | ports/imgui-sfml/usage | 10 |
7 files changed, 81 insertions, 87 deletions
diff --git a/ports/imgui-sfml/0001-fix_find_package.patch b/ports/imgui-sfml/0001-fix_find_package.patch new file mode 100644 index 000000000..d5dc24456 --- /dev/null +++ b/ports/imgui-sfml/0001-fix_find_package.patch @@ -0,0 +1,50 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 53500fd..cb98701 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,34 +35,14 @@ if (IMGUI_SFML_FIND_SFML) + if (NOT BUILD_SHARED_LIBS) + set(SFML_STATIC_LIBRARIES ON) + endif() +- find_package(SFML 2.5 COMPONENTS graphics system window) ++ find_package(SFML COMPONENTS graphics system window) + + if(NOT SFML_FOUND) + message(FATAL_ERROR "SFML 2 directory not found. Set SFML_DIR to directory where SFML was built (or one which ccontains SFMLConfig.cmake)") + endif() + endif() + +-# ImGui does not provide native support for CMakeLists, workaround for now to have +-# users specify IMGUI_DIR. Waiting for this PR to get merged... +-# https://github.com/ocornut/imgui/pull/1713 +-if(NOT IMGUI_DIR) +- set(IMGUI_DIR "" CACHE PATH "imgui top-level directory") +- message(FATAL_ERROR "ImGui directory not found. Set IMGUI_DIR to imgui's top-level path (containing 'imgui.h' and other files).\n") +-endif() +- +-# This uses FindImGui.cmake provided in ImGui-SFML repo for now +-find_package(ImGui 1.68 REQUIRED) +- +-# these headers will be installed alongside ImGui-SFML +-set(IMGUI_PUBLIC_HEADERS +- ${IMGUI_INCLUDE_DIR}/imconfig.h +- ${IMGUI_INCLUDE_DIR}/imgui.h +- ${IMGUI_INCLUDE_DIR}/imgui_internal.h # not actually public, but users might need it +- ${IMGUI_INCLUDE_DIR}/imstb_rectpack.h +- ${IMGUI_INCLUDE_DIR}/imstb_textedit.h +- ${IMGUI_INCLUDE_DIR}/imstb_truetype.h +- ${IMGUI_INCLUDE_DIR}/misc/cpp/imgui_stdlib.h +-) ++find_package(imgui CONFIG REQUIRED) + + # CMake 3.11 and later prefer to choose GLVND, but we choose legacy OpenGL just because it's safer + # (unless the OpenGL_GL_PREFERENCE was explicitly set) +@@ -82,7 +62,7 @@ add_library(ImGui-SFML + add_library(ImGui-SFML::ImGui-SFML ALIAS ImGui-SFML) + + target_link_libraries(ImGui-SFML +- PUBLIC ++ imgui::imgui + sfml-graphics + sfml-system + sfml-window diff --git a/ports/imgui-sfml/0002-fix_imgui_config.patch b/ports/imgui-sfml/0002-fix_imgui_config.patch new file mode 100644 index 000000000..6966b63c7 --- /dev/null +++ b/ports/imgui-sfml/0002-fix_imgui_config.patch @@ -0,0 +1,11 @@ +diff --git a/imconfig-SFML.h b/imconfig-SFML.h +index f66ba20..0f43ce6 100644 +--- a/imconfig-SFML.h ++++ b/imconfig-SFML.h +@@ -28,5 +28,3 @@ + static_cast<sf::Uint8>(z * 255.f), \ + static_cast<sf::Uint8>(w * 255.f)); \ + } +- +-#define ImTextureID unsigned int +\ No newline at end of file diff --git a/ports/imgui-sfml/remove-delegating-ctor.patch b/ports/imgui-sfml/0003-fix_osx.patch index a0442fc13..8181ee8e1 100644 --- a/ports/imgui-sfml/remove-delegating-ctor.patch +++ b/ports/imgui-sfml/0003-fix_osx.patch @@ -3,7 +3,7 @@ index 0f43ce6..1fce2c1 100644 --- a/imconfig-SFML.h +++ b/imconfig-SFML.h @@ -19,7 +19,7 @@ - + #define IM_VEC4_CLASS_EXTRA \ ImVec4(const sf::Color & c) \ - : ImVec4(c.r / 255.f, c.g / 255.f, c.b / 255.f, c.a / 255.f) { \ diff --git a/ports/imgui-sfml/CONTROL b/ports/imgui-sfml/CONTROL index f72f50db8..8db3a4ac6 100644 --- a/ports/imgui-sfml/CONTROL +++ b/ports/imgui-sfml/CONTROL @@ -1,5 +1,5 @@ Source: imgui-sfml -Version: 2.0.2 +Version: 2.1 Homepage: https://github.com/eliasdaler/imgui-sfml -Description: Library which allows you to use ImGui with SFML +Description: ImGui binding for use with SFML Build-Depends: sfml, imgui diff --git a/ports/imgui-sfml/portfile.cmake b/ports/imgui-sfml/portfile.cmake index 4cc33edb9..47c25669e 100644 --- a/ports/imgui-sfml/portfile.cmake +++ b/ports/imgui-sfml/portfile.cmake @@ -1,30 +1,24 @@ include(vcpkg_common_functions) -# Compile as static lib since vcpkg's imgui is compiled as static lib -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eliasdaler/imgui-sfml - REF v2.0.2 - SHA512 44099e162c0e712ec9147452189649801a6463396830e117c7a0a4483d0526e94554498bfa41e9cd418d26286b5d1a28dd1c2d305c30d1eb266922767e53ab48 + REF v2.1 + SHA512 134c49e9c57bc4d3882d99a52ec87f74c11d2f3134501c79b20bce4612f315f2e3f33a521597b387ca8f91942cf2b82ec9f4a8b1672a700e7233a9758897b6d0 HEAD_REF master PATCHES - static-build-with-vcpkg-imgui.patch - remove-delegating-ctor.patch + 0001-fix_find_package.patch + 0002-fix_imgui_config.patch + 0003-fix_osx.patch ) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA ) - vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ImGui-SFML) vcpkg_copy_pdbs() -# Debug include directory not needed +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ImGui-SFML) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - -# License -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/imgui-sfml RENAME copyright) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/imgui-sfml/copyright COPYONLY) diff --git a/ports/imgui-sfml/static-build-with-vcpkg-imgui.patch b/ports/imgui-sfml/static-build-with-vcpkg-imgui.patch deleted file mode 100644 index 0432a5c26..000000000 --- a/ports/imgui-sfml/static-build-with-vcpkg-imgui.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 015a030..33d6894 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,7 +29,7 @@ set(IMGUI_SFML_CONFIG_NAME "imconfig-SFML.h" CACHE STRING "Name of a custom user - set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header will be installed") - - # For FindImGui.cmake --list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") -+# list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") - - if (IMGUI_SFML_FIND_SFML) - find_package(SFML 2.5 COMPONENTS graphics system window) -@@ -42,24 +42,24 @@ endif() - # ImGui does not provide native support for CMakeLists, workaround for now to have - # users specify IMGUI_DIR. Waiting for this PR to get merged... - # https://github.com/ocornut/imgui/pull/1713 --if(NOT IMGUI_DIR) -- set(IMGUI_DIR "" CACHE PATH "imgui top-level directory") -- message(FATAL_ERROR "ImGui directory not found. Set IMGUI_ROOT to imgui's top-level path (containing 'imgui.h' and other files).\n") --endif() -+# if(NOT IMGUI_DIR) -+ # set(IMGUI_DIR "" CACHE PATH "imgui top-level directory") -+ # message(FATAL_ERROR "ImGui directory not found. Set IMGUI_ROOT to imgui's top-level path (containing 'imgui.h' and other files).\n") -+# endif() - - # This uses FindImGui.cmake provided in ImGui-SFML repo for now --find_package(ImGui 1.68 REQUIRED) -+find_package(imgui REQUIRED) - - # these headers will be installed alongside ImGui-SFML --set(IMGUI_PUBLIC_HEADERS -- ${IMGUI_INCLUDE_DIR}/imconfig.h -- ${IMGUI_INCLUDE_DIR}/imgui.h -- ${IMGUI_INCLUDE_DIR}/imgui_internal.h # not actually public, but users might need it -- ${IMGUI_INCLUDE_DIR}/imstb_rectpack.h -- ${IMGUI_INCLUDE_DIR}/imstb_textedit.h -- ${IMGUI_INCLUDE_DIR}/imstb_truetype.h -- ${IMGUI_INCLUDE_DIR}/misc/cpp/imgui_stdlib.h --) -+# set(IMGUI_PUBLIC_HEADERS -+ # ${IMGUI_INCLUDE_DIR}/imconfig.h -+ # ${IMGUI_INCLUDE_DIR}/imgui.h -+ # ${IMGUI_INCLUDE_DIR}/imgui_internal.h # not actually public, but users might need it -+ # ${IMGUI_INCLUDE_DIR}/imstb_rectpack.h -+ # ${IMGUI_INCLUDE_DIR}/imstb_textedit.h -+ # ${IMGUI_INCLUDE_DIR}/imstb_truetype.h -+ # ${IMGUI_INCLUDE_DIR}/misc/cpp/imgui_stdlib.h -+# ) - - # CMake 3.11 and later prefer to choose GLVND, but we choose legacy OpenGL just because it's safer - # (unless the OpenGL_GL_PREFERENCE was explicitly set) -@@ -80,6 +80,7 @@ add_library(ImGui-SFML::ImGui-SFML ALIAS ImGui-SFML) - - target_link_libraries(ImGui-SFML - PUBLIC -+ imgui::imgui - sfml-graphics - sfml-system - sfml-window -diff --git a/imconfig-SFML.h b/imconfig-SFML.h -index f66ba20..0f43ce6 100644 ---- a/imconfig-SFML.h -+++ b/imconfig-SFML.h -@@ -28,5 +28,3 @@ - static_cast<sf::Uint8>(z * 255.f), \ - static_cast<sf::Uint8>(w * 255.f)); \ - } -- --#define ImTextureID unsigned int -\ No newline at end of file diff --git a/ports/imgui-sfml/usage b/ports/imgui-sfml/usage new file mode 100644 index 000000000..ea9a5f63b --- /dev/null +++ b/ports/imgui-sfml/usage @@ -0,0 +1,10 @@ +The package imgui-sfml provides CMake targets: + + find_package(imgui CONFIG REQUIRED) + find_package(SFML CONFIG REQUIRED COMPONENTS graphics system window) + find_package(ImGui-SFML CONFIG REQUIRED) + target_link_libraries(main PRIVATE + imgui::imgui + sfml-graphics sfml-system sfml-window + ImGui-SFML::ImGui-SFML + ) |
