2016-12-07 22:02:23 +00:00
include ( vcpkg_common_functions )
2017-09-23 16:19:29 +00:00
vcpkg_from_github ( OUT_SOURCE_PATH SOURCE_PATH
2018-04-27 10:15:17 +00:00
R E P O S F M L / S F M L
2018-05-15 08:31:52 +00:00
R E F 2 . 5 . 0
2017-09-23 16:19:29 +00:00
H E A D _ R E F m a s t e r
2018-05-15 08:31:52 +00:00
S H A 5 1 2 9 4 3 0 6 d c b e d 7 d 6 8 b b 7 e 2 2 6 c d 9 1 e 2 5 9 5 0 a 0 7 b c f 3 9 3 9 8 8 c 4 b b 7 9 f 9 d e 3 5 5 5 c 1 8 c 7 8 c a e 4 5 7 3 e 9 1 1 2 3 5 f 7 1 2 e 7 1 1 a 7 c 0 2 a 6 1 4 b f 3 7 0 d f 3 2 b 8 d 8 5 2 4 0 d 2 f 0 8 1 4 2 3 2 7 e 0 5 0 7 6
2018-05-20 02:40:08 +00:00
P A T C H E S " $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / p o r t f i l e . c m a k e "
2018-04-27 10:15:17 +00:00
)
2016-12-07 22:02:23 +00:00
file ( REMOVE_RECURSE ${ SOURCE_PATH } /extlibs )
2018-05-20 02:40:08 +00:00
# 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 "" )
2016-12-07 22:02:23 +00:00
2018-04-27 10:15:17 +00:00
if ( VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
message ( "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 mesa-common-dev" )
endif ( )
2016-12-07 22:02:23 +00:00
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
2018-05-20 02:40:08 +00:00
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
2018-04-27 10:15:17 +00:00
)
2016-12-07 22:02:23 +00:00
vcpkg_install_cmake ( )
2018-05-20 02:40:08 +00:00
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/cmake/SFML )
2016-12-07 22:02:23 +00:00
vcpkg_copy_pdbs ( )
# don't force users to define SFML_STATIC while using static library
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
file ( APPEND ${ CURRENT_PACKAGES_DIR } /include/SFML/Config.hpp "#undef SFML_API_IMPORT\n#define SFML_API_IMPORT\n" )
endif ( )
# move sfml-main to manual link dir
2018-04-27 10:15:17 +00:00
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 )
2018-05-20 02:40:08 +00:00
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 ( )
2018-04-27 10:15:17 +00:00
endif ( )
2016-12-07 22:02:23 +00:00
2018-05-20 02:40:08 +00:00
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include ${ CURRENT_PACKAGES_DIR } /debug/share )
2018-05-15 08:31:52 +00:00
file ( INSTALL ${ SOURCE_PATH } /license.md DESTINATION ${ CURRENT_PACKAGES_DIR } /share/sfml RENAME copyright )