diff options
| author | Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> | 2020-05-16 05:11:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 14:11:26 -0700 |
| commit | 6319183413e23cfb6bb8323d388ff60404892e15 (patch) | |
| tree | 03a8ed2cac601b32e2af78d71e80bd89a1a2899d | |
| parent | 9b796363050e06704c0d1491defe07e2204bba28 (diff) | |
| download | vcpkg-6319183413e23cfb6bb8323d388ff60404892e15.tar.gz vcpkg-6319183413e23cfb6bb8323d388ff60404892e15.zip | |
[imgui-sfml] Force imgui-sfml to be a static library (#10840)
* [imgui-sfml] Force imgui-sfml as a static library
* [imgui-sfml] Change the way to detect sfml
| -rw-r--r-- | ports/imgui-sfml/004-fix-find-sfml.patch | 14 | ||||
| -rw-r--r-- | ports/imgui-sfml/CONTROL | 2 | ||||
| -rw-r--r-- | ports/imgui-sfml/portfile.cmake | 21 |
3 files changed, 34 insertions, 3 deletions
diff --git a/ports/imgui-sfml/004-fix-find-sfml.patch b/ports/imgui-sfml/004-fix-find-sfml.patch new file mode 100644 index 000000000..51cc0634b --- /dev/null +++ b/ports/imgui-sfml/004-fix-find-sfml.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4d7a3fa..614564f 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 + 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) diff --git a/ports/imgui-sfml/CONTROL b/ports/imgui-sfml/CONTROL index 8db3a4ac6..ee43509de 100644 --- a/ports/imgui-sfml/CONTROL +++ b/ports/imgui-sfml/CONTROL @@ -1,5 +1,5 @@ Source: imgui-sfml -Version: 2.1 +Version: 2.1-1 Homepage: https://github.com/eliasdaler/imgui-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 47c25669e..d283a2624 100644 --- a/ports/imgui-sfml/portfile.cmake +++ b/ports/imgui-sfml/portfile.cmake @@ -1,4 +1,4 @@ -include(vcpkg_common_functions) +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -10,15 +10,32 @@ vcpkg_from_github( 0001-fix_find_package.patch 0002-fix_imgui_config.patch 0003-fix_osx.patch + 004-fix-find-sfml.patch ) +if (VCPKG_TARGET_IS_WINDOWS) + file(GLOB SFML_DYNAMIC_LIBS "${CURRENT_INSTALLED_DIR}/bin/sfml-*") +else() + file(GLOB SFML_DYNAMIC_LIBS "${CURRENT_INSTALLED_DIR}/bin/libsfml-*") +endif() + +if (SFML_DYNAMIC_LIBS) + set(SFML_STATIC OFF) +else() + set(SFML_STATIC ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + OPTIONS + -DSFML_STATIC_LIBRARIES=${SFML_STATIC} ) vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ImGui-SFML) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/imgui-sfml/copyright COPYONLY) + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) |
