mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-14 06:28:00 +08:00
[imgui-sfml] Fix build and exported config (#32982)
* [imgui-sfml] Restore linking keyword * Merge patches * Move config to lower-case dir * Add find_dependency * Update versions * Trim patch
This commit is contained in:
parent
2973016c49
commit
3ee6678f87
@ -2,10 +2,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 3a974c4..8a1c6cd 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -41,34 +41,14 @@ if (IMGUI_SFML_FIND_SFML)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
set(SFML_STATIC_LIBRARIES ON)
|
||||
endif()
|
||||
@@ -38,37 +38,14 @@ 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)
|
||||
- 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)
|
||||
|
||||
@ -39,11 +42,10 @@ index 3a974c4..8a1c6cd 100644
|
||||
|
||||
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)
|
||||
@@ -93,6 +70,7 @@ add_library(ImGui-SFML
|
||||
|
||||
target_link_libraries(ImGui-SFML
|
||||
- PUBLIC
|
||||
PUBLIC
|
||||
+ imgui::imgui
|
||||
sfml-graphics
|
||||
sfml-system
|
||||
|
@ -1,14 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8a1c6cd..7156f51 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -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)
|
||||
- if (NOT BUILD_SHARED_LIBS)
|
||||
- set(SFML_STATIC_LIBRARIES ON)
|
||||
- endif()
|
||||
find_package(SFML COMPONENTS graphics system window)
|
||||
|
||||
if(NOT SFML_FOUND)
|
@ -9,7 +9,6 @@ vcpkg_from_github(
|
||||
PATCHES
|
||||
0001-fix_find_package.patch
|
||||
0002-fix-imgui-dependency.patch
|
||||
004-fix-find-sfml.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
@ -20,7 +19,14 @@ vcpkg_cmake_configure(
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME ImGui-SFML CONFIG_PATH lib/cmake/ImGui-SFML)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ImGui-SFML)
|
||||
file(READ "${CURRENT_PACKAGES_DIR}/share/imgui-sfml/ImGui-SFMLConfig.cmake" cmake_config)
|
||||
string(PREPEND cmake_config [[
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(imgui CONFIG)
|
||||
find_dependency(SFML COMPONENTS graphics system window)
|
||||
]])
|
||||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/imgui-sfml/ImGui-SFMLConfig.cmake" "${cmake_config}")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
|
@ -1,10 +1,4 @@
|
||||
The package imgui-sfml provides CMake targets:
|
||||
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
|
||||
)
|
||||
target_link_libraries(main PRIVATE ImGui-SFML::ImGui-SFML)
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "imgui-sfml",
|
||||
"version": "2.5",
|
||||
"port-version": 3,
|
||||
"port-version": 4,
|
||||
"description": "ImGui binding for use with SFML",
|
||||
"homepage": "https://github.com/eliasdaler/imgui-sfml",
|
||||
"license": "MIT",
|
||||
|
@ -3378,7 +3378,7 @@
|
||||
},
|
||||
"imgui-sfml": {
|
||||
"baseline": "2.5",
|
||||
"port-version": 3
|
||||
"port-version": 4
|
||||
},
|
||||
"imguizmo": {
|
||||
"baseline": "1.83",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "62fe2b504e6630d4d191ba92ffb288e109260835",
|
||||
"version": "2.5",
|
||||
"port-version": 4
|
||||
},
|
||||
{
|
||||
"git-tree": "824afd9c0aaca961fb9346dff3a957b26ee5eb2c",
|
||||
"version": "2.5",
|
||||
|
Loading…
x
Reference in New Issue
Block a user