-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
81 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |