2019-10-08 01:35:13 +08:00
vcpkg_from_github ( OUT_SOURCE_PATH SOURCE_PATH
R E P O S F M L / S F M L
R E F 2 . 5 . 1
H E A D _ R E F m a s t e r
S H A 5 1 2 7 a e d 2 f c 2 9 d 1 d a 9 8 e 6 c 4 d 5 9 8 d 5 c 8 6 c f 5 3 6 c b 4 e b 5 c 2 0 7 9 c d c 2 3 b b 8 e 5 0 2 2 8 8 8 3 3 c 0 5 2 5 7 9 d a d b e 0 c e 1 3 a d 6 4 6 1 7 9 2 d 9 5 9 b f 6 d 9 6 6 0 2 2 9 f 5 4 c 5 4 c f 9 0 a 5 4 1 c 8 8 c 6 b 0 3 d 5 9
2020-01-16 05:45:48 +08:00
P A T C H E S
u s e - s y s t e m - f r e e t y p e . p a t c h
2020-08-07 04:07:46 +08:00
s t b _ i n c l u d e . p a t c h
2019-10-08 01:35:13 +08:00
)
file ( REMOVE_RECURSE ${ SOURCE_PATH } /extlibs )
# Without this, we get error: list sub-command REMOVE_DUPLICATES requires list to be present.
file ( MAKE_DIRECTORY ${ SOURCE_PATH } /extlibs/libs )
file ( WRITE ${ SOURCE_PATH } /extlibs/libs/x "" )
# The embedded FindFreetype doesn't properly handle debug libraries
file ( REMOVE_RECURSE ${ SOURCE_PATH } /cmake/Modules/FindFreetype.cmake )
if ( VCPKG_TARGET_IS_LINUX )
message ( STATUS "SFML currently requires the following libraries from the system package manager:\n libudev\n libx11\n libxrandr\n opengl\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev libxrandr-dev libxi-dev libudev-dev libgl1-mesa-dev" )
endif ( )
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R E F E R _ N I N J A
O P T I O N S
- D S F M L _ B U I L D _ F R A M E W O R K S = O F F
- D S F M L _ U S E _ S Y S T E M _ D E P S = O N
- D S F M L _ M I S C _ I N S T A L L _ P R E F I X = s h a r e / s f m l
- D S F M L _ G E N E R A T E _ P D B = O F F
)
vcpkg_install_cmake ( )
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/cmake/SFML )
vcpkg_copy_pdbs ( )
2020-08-22 16:29:59 +08:00
FILE ( READ ${ CURRENT_PACKAGES_DIR } /share/sfml/SFMLConfig.cmake SFML_CONFIG )
2019-10-08 01:35:13 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
FILE ( WRITE ${ CURRENT_PACKAGES_DIR } /share/sfml/SFMLConfig.cmake "set(SFML_STATIC_LIBRARIES true)\ninclude(CMakeFindDependencyMacro)\nfind_dependency(Freetype)\n${SFML_CONFIG}" )
2020-08-22 16:29:59 +08:00
else ( )
FILE ( WRITE ${ CURRENT_PACKAGES_DIR } /share/sfml/SFMLConfig.cmake "set(SFML_STATIC_LIBRARIES false)\n${SFML_CONFIG}" )
2019-10-08 01:35:13 +08:00
endif ( )
# move sfml-main to manual link dir
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /lib/sfml-main.lib )
file ( COPY ${ CURRENT_PACKAGES_DIR } /lib/sfml-main.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /lib/manual-link )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /lib/sfml-main.lib )
file ( COPY ${ CURRENT_PACKAGES_DIR } /debug/lib/sfml-main-d.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib/manual-link )
file ( REMOVE ${ CURRENT_PACKAGES_DIR } /debug/lib/sfml-main-d.lib )
file ( GLOB FILES "${CURRENT_PACKAGES_DIR}/share/sfml/SFML*Targets-*.cmake" )
foreach ( FILE ${ FILES } )
file ( READ "${FILE}" _contents )
string ( REPLACE "/lib/sfml-main" "/lib/manual-link/sfml-main" _contents "${_contents}" )
file ( WRITE "${FILE}" "${_contents}" )
endforeach ( )
endif ( )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include ${ CURRENT_PACKAGES_DIR } /debug/share )
2021-01-21 05:03:02 +08:00
configure_file ( ${ CMAKE_CURRENT_LIST_DIR } /usage ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } /usage COPYONLY )
configure_file ( ${ SOURCE_PATH } /license.md ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } /copyright COPYONLY )