vcpkg/ports/imgui-sfml/static-build-with-vcpkg-imgui.patch
Tri Tran 79b5a9ae58 [imgui-sfml] Add new port (#7429)
* [imgui-sfml] Add new package ImGui-SFML

* Static build only to match with `imgui`.

* [imgui-sfml] Fix case-sensitive imgui package name

* [imgui-sfml] Require C++11

* [imgui-sfml] Include IMGUI_API define

* [imgui-sfml] Remove delegating ctor - C++11 is not required
2019-09-03 14:45:31 -07:00

72 lines
2.8 KiB
Diff

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