mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[thor][sfgui] Fix outdated FindSFML.cmake files
This commit is contained in:
parent
67da15682a
commit
c70e9d895f
@ -1,4 +1,4 @@
|
||||
Source: sfgui
|
||||
Version: 0.3.2-1
|
||||
Version: 0.3.2-2
|
||||
Description: simple and fast graphical user interface library
|
||||
Build-Depends: sfml
|
||||
|
@ -6,15 +6,12 @@ vcpkg_from_github(
|
||||
REF 0.3.2
|
||||
SHA512 cd97e421695f6189995c1b7a4180e3738bf785abae37d3eb51ac6d687a88a26a1f088863b37e065edaff6ba43eea379e423b31118324c4daa65dba0b3e904869
|
||||
HEAD_REF master
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/use-sfml-targets.patch"
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(SFGUI_BUILD_SHARED_LIBS ON)
|
||||
set(SFML_STATIC_LIBRARIES OFF)
|
||||
else()
|
||||
set(SFGUI_BUILD_SHARED_LIBS OFF)
|
||||
set(SFML_STATIC_LIBRARIES ON)
|
||||
endif()
|
||||
file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindSFML.cmake)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SFGUI_BUILD_SHARED_LIBS)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
@ -23,7 +20,6 @@ vcpkg_configure_cmake(
|
||||
-DSFGUI_BUILD_DOC=OFF
|
||||
-DSFGUI_BUILD_EXAMPLES=OFF
|
||||
-DSFGUI_BUILD_SHARED_LIBS=${SFGUI_BUILD_SHARED_LIBS}
|
||||
-DSFML_STATIC_LIBRARIES=${SFML_STATIC_LIBRARIES}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
44
ports/sfgui/use-sfml-targets.patch
Normal file
44
ports/sfgui/use-sfml-targets.patch
Normal file
@ -0,0 +1,44 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index abc9be0..eb999f5 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -190,7 +190,6 @@ endif()
|
||||
|
||||
include_directories( "${INCLUDE_PATH}" )
|
||||
include_directories( "${SOURCE_PATH}" )
|
||||
-include_directories( SYSTEM "${SFML_INCLUDE_DIR}" )
|
||||
include_directories( SYSTEM "${PROJECT_SOURCE_DIR}/extlibs/libELL/include" )
|
||||
|
||||
# Set the library output directory
|
||||
@@ -244,7 +243,7 @@ if( WIN32 )
|
||||
endif()
|
||||
|
||||
add_definitions( -DWIN32 )
|
||||
- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} )
|
||||
+ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} )
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
if( SFGUI_BUILD_SHARED_LIBS )
|
||||
@@ -261,11 +260,11 @@ elseif( APPLE )
|
||||
mark_as_advanced( COREFOUNDATION_LIBRARY )
|
||||
|
||||
include_directories( SYSTEM /System/Library/Frameworks/CoreFoundation.framework/Headers )
|
||||
- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ${COREFOUNDATION_LIBRARY} )
|
||||
+ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ${COREFOUNDATION_LIBRARY} )
|
||||
set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" )
|
||||
set( LIB_PATH "lib" )
|
||||
elseif( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" )
|
||||
- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} ${X11_LIBRARIES} )
|
||||
+ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} ${X11_LIBRARIES} )
|
||||
set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" )
|
||||
|
||||
if( LIB_SUFFIX )
|
||||
@@ -274,7 +273,7 @@ elseif( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" )
|
||||
set( LIB_PATH "lib" )
|
||||
endif()
|
||||
else()
|
||||
- target_link_libraries( sfgui ${SFML_LIBRARIES} ${SFML_DEPENDENCIES} ${OPENGL_gl_LIBRARY} )
|
||||
+ target_link_libraries( sfgui sfml-graphics sfml-window sfml-system ${OPENGL_gl_LIBRARY} )
|
||||
set( SHARE_PATH "${CMAKE_INSTALL_PREFIX}/share/SFGUI" )
|
||||
set( LIB_PATH "lib" )
|
||||
endif()
|
@ -1,4 +1,4 @@
|
||||
Source: thor
|
||||
Version: 2.0-1
|
||||
Version: 2.0-2
|
||||
Description: Extends the multimedia library SFML with higher-level features
|
||||
Build-Depends: sfml, aurora
|
||||
|
@ -1,45 +1,31 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/tests)
|
||||
vcpkg_from_github(ARCHIVE
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO Bromeon/Thor
|
||||
REF v2.0
|
||||
SHA512 634fa5286405d9a8a837c082ace98bbb02e609521418935855b9e2fcad57003dbe35088bd771cf6a9292e55d3787f7e463d7a4cca0d0f007509de2520d9a8cf9
|
||||
HEAD_REF master
|
||||
PATCHES "${CMAKE_CURRENT_LIST_DIR}/sfml-no-depend-libjpeg.patch"
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH}/extlibs)
|
||||
file(COPY ${CURRENT_INSTALLED_DIR}/include/Aurora DESTINATION ${SOURCE_PATH}/extlibs/aurora/include)
|
||||
file(WRITE "${SOURCE_PATH}/extlibs/aurora/License.txt")
|
||||
|
||||
|
||||
set(ENV{SFML_ROOT} ${CURRENT_INSTALLED_DIR})
|
||||
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
set(THOR_STATIC_STD_LIBS ON)
|
||||
else()
|
||||
set(THOR_STATIC_STD_LIBS OFF)
|
||||
endif()
|
||||
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(THOR_SHARED_LIBS ON)
|
||||
else()
|
||||
set(THOR_SHARED_LIBS OFF)
|
||||
endif()
|
||||
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" THOR_STATIC_STD_LIBS)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" THOR_SHARED_LIBS)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DTHOR_SHARED_LIBS=${THOR_SHARED_LIBS}
|
||||
-DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS}
|
||||
-DTHOR_SHARED_LIBS=${THOR_SHARED_LIBS}
|
||||
-DTHOR_STATIC_STD_LIBS=${THOR_STATIC_STD_LIBS}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
|
||||
set(CONFIG_FILE "${CURRENT_PACKAGES_DIR}/include/Thor/Config.hpp")
|
||||
|
||||
file(READ ${CONFIG_FILE} CONFIG_H)
|
||||
@ -48,7 +34,6 @@ file(READ ${CONFIG_FILE} CONFIG_H)
|
||||
else()
|
||||
string(REPLACE "defined(SFML_STATIC)" "0" CONFIG_H "${CONFIG_H}")
|
||||
endif()
|
||||
|
||||
file(WRITE ${CONFIG_FILE} "${CONFIG_H}")
|
||||
|
||||
file(GLOB LICENSE
|
||||
|
16
ports/thor/sfml-no-depend-libjpeg.patch
Normal file
16
ports/thor/sfml-no-depend-libjpeg.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake
|
||||
index 48873ef..a1834f6 100644
|
||||
--- a/cmake/Modules/FindSFML.cmake
|
||||
+++ b/cmake/Modules/FindSFML.cmake
|
||||
@@ -312,10 +312,9 @@ if(SFML_STATIC_LIBRARIES)
|
||||
|
||||
# find libraries
|
||||
find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
|
||||
- find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
|
||||
|
||||
# update the list
|
||||
- set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
|
||||
+ set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY})
|
||||
set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user