Skip to content

Commit

Permalink
[imgui-sfml] update to v2.3 (#20926)
Browse files Browse the repository at this point in the history
* [imgui-sfml] update to v2.3

* update version

* change patch format from CRLF to CF

* update version

* Finish suggested change

* update version
  • Loading branch information
JonLiu1993 authored Oct 27, 2021
1 parent fa14828 commit aa105d9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 41 deletions.
12 changes: 6 additions & 6 deletions ports/imgui-sfml/0001-fix_find_package.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53500fd..cb98701 100644
index 3a974c4..8a1c6cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,34 +35,14 @@ if (IMGUI_SFML_FIND_SFML)
@@ -41,34 +41,14 @@ if (IMGUI_SFML_FIND_SFML)
if (NOT BUILD_SHARED_LIBS)
set(SFML_STATIC_LIBRARIES ON)
endif()
Expand All @@ -23,7 +23,7 @@ index 53500fd..cb98701 100644
-endif()
-
-# This uses FindImGui.cmake provided in ImGui-SFML repo for now
-find_package(ImGui 1.68 REQUIRED)
-find_package(ImGui 1.80 REQUIRED)
-
-# these headers will be installed alongside ImGui-SFML
-set(IMGUI_PUBLIC_HEADERS
Expand All @@ -37,9 +37,9 @@ index 53500fd..cb98701 100644
-)
+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
if (IMGUI_SFML_IMGUI_DEMO)
list(APPEND IMGUI_SOURCES ${IMGUI_DEMO_SOURCES})
@@ -92,7 +72,7 @@ add_library(ImGui-SFML
add_library(ImGui-SFML::ImGui-SFML ALIAS ImGui-SFML)

target_link_libraries(ImGui-SFML
Expand Down
9 changes: 4 additions & 5 deletions ports/imgui-sfml/0002-fix_imgui_config.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
diff --git a/imconfig-SFML.h b/imconfig-SFML.h
index f66ba20..0f43ce6 100644
index ddfe05d..4e7634e 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)); \
@@ -23,5 +23,3 @@
return sf::Color(static_cast<sf::Uint8>(x * 255.f), static_cast<sf::Uint8>(y * 255.f), \
static_cast<sf::Uint8>(z * 255.f), static_cast<sf::Uint8>(w * 255.f)); \
}
-
-#define ImTextureID unsigned int
\ No newline at end of file
13 changes: 0 additions & 13 deletions ports/imgui-sfml/0003-fix_osx.patch

This file was deleted.

4 changes: 2 additions & 2 deletions ports/imgui-sfml/004-fix-find-sfml.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4d7a3fa..614564f 100644
index 8a1c6cd..7156f51 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,9 +32,6 @@ set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header
@@ -38,9 +38,6 @@ set(IMGUI_SFML_CONFIG_INSTALL_DIR "" CACHE PATH "Path where user's config header
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

if (IMGUI_SFML_FIND_SFML)
Expand Down
18 changes: 8 additions & 10 deletions ports/imgui-sfml/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eliasdaler/imgui-sfml
REF v2.1
SHA512 134c49e9c57bc4d3882d99a52ec87f74c11d2f3134501c79b20bce4612f315f2e3f33a521597b387ca8f91942cf2b82ec9f4a8b1672a700e7233a9758897b6d0
REF 82dc2033e51b8323857c3ae1cf1f458b3a933c35 #v2.3
SHA512 f27a0e65aa20229c73b27c4232269908dfeb5d78b1cef7299a179ecac6194d9829e148e95ed54b4500ffd36ada09fdbfadf67588c78bee87aff446ae80347bcf
HEAD_REF master
PATCHES
0001-fix_find_package.patch
0002-fix_imgui_config.patch
0003-fix_osx.patch
004-fix-find-sfml.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ImGui-SFML)
vcpkg_cmake_config_fixup(PACKAGE_NAME ImGui-SFML CONFIG_PATH lib/cmake/ImGui-SFML)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
13 changes: 10 additions & 3 deletions ports/imgui-sfml/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"name": "imgui-sfml",
"version-string": "2.1",
"port-version": 3,
"version": "2.3",
"description": "ImGui binding for use with SFML",
"homepage": "https://github.com/eliasdaler/imgui-sfml",
"dependencies": [
"imgui",
"opengl",
"sfml"
"sfml",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2813,8 +2813,8 @@
"port-version": 0
},
"imgui-sfml": {
"baseline": "2.1",
"port-version": 3
"baseline": "2.3",
"port-version": 0
},
"imguizmo": {
"baseline": "1.83",
Expand Down
5 changes: 5 additions & 0 deletions versions/i-/imgui-sfml.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "2ece5bd925368d6ef9b7295b31f7f2de86179f4e",
"version": "2.3",
"port-version": 0
},
{
"git-tree": "57e3ab9f08cd10a7d66717044636c02349ee2ea3",
"version-string": "2.1",
Expand Down

0 comments on commit aa105d9

Please sign in to comment.