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
2023-05-12 01:03:00 +08:00
R E F " $ { V E R S I O N } "
2019-10-08 01:35:13 +08:00
H E A D _ R E F m a s t e r
2024-11-14 18:06:25 +08:00
S H A 5 1 2 d 8 a 8 b e e 3 a a 9 a c d a 4 6 0 9 1 0 4 c 2 a 9 d 4 a 2 5 1 2 e 4 b e 6 d 6 e 8 5 f d 4 b 2 4 c 2 8 7 c 0 3 f 6 0 c f b 8 8 8 e 6 6 9 e 6 1 b f a c 4 1 1 3 d a e 3 5 f 0 c 3 4 9 2 5 5 9 b 6 5 b 3 4 5 3 b a f 3 8 7 6 6 d 8 c 0 2 2 3 d 9 a b 7 7 a a d a
2020-01-16 05:45:48 +08:00
P A T C H E S
2022-08-05 10:18:37 +08:00
f i x - d e p e n d e n c i e s . p a t c h
2024-11-14 18:06:25 +08:00
f i x - d e p - o p e n a l . p a t c h
2019-10-08 01:35:13 +08:00
)
# The embedded FindFreetype doesn't properly handle debug libraries
2022-01-26 14:49:34 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/cmake/Modules/FindFreetype.cmake" )
2019-10-08 01:35:13 +08:00
if ( VCPKG_TARGET_IS_LINUX )
2023-06-24 04:23:10 +08:00
message ( STATUS "SFML currently requires the following libraries from the system package manager:\n libudev\n libx11\n libxrandr\n libxcursor\n opengl\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev" )
2019-10-08 01:35:13 +08:00
endif ( )
2024-11-01 15:48:41 +08:00
vcpkg_check_features (
O U T _ F E A T U R E _ O P T I O N S F E A T U R E _ O P T I O N S
F E A T U R E S
" n e t w o r k " S F M L _ B U I L D _ N E T W O R K
" g r a p h i c s " S F M L _ B U I L D _ G R A P H I C S
" w i n d o w " S F M L _ B U I L D _ W I N D O W
" a u d i o " S F M L _ B U I L D _ A U D I O
)
2022-01-26 14:49:34 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2019-10-08 01:35:13 +08: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
2023-08-04 21:57:21 +08:00
- D S F M L _ W A R N I N G S _ A S _ E R R O R S = O F F #Remove in the next version
2024-11-01 15:48:41 +08:00
$ { F E A T U R E _ O P T I O N S }
2024-11-14 18:06:25 +08:00
M A Y B E _ U N U S E D _ V A R I A B L E S
S F M L _ M I S C _ I N S T A L L _ P R E F I X
S F M L _ W A R N I N G S _ A S _ E R R O R S
2019-10-08 01:35:13 +08:00
)
2022-01-26 14:49:34 +08:00
vcpkg_cmake_install ( )
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/SFML )
2019-10-08 01:35:13 +08:00
vcpkg_copy_pdbs ( )
# move sfml-main to manual link dir
2022-01-26 14:49:34 +08: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" )
2019-10-08 01:35:13 +08:00
file ( GLOB FILES "${CURRENT_PACKAGES_DIR}/share/sfml/SFML*Targets-*.cmake" )
foreach ( FILE ${ FILES } )
2022-01-26 14:49:34 +08:00
vcpkg_replace_string ( "${FILE}" "/lib/sfml-main" "/lib/manual-link/sfml-main" )
2019-10-08 01:35:13 +08:00
endforeach ( )
endif ( )
2023-05-12 01:03:00 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/sfml-main-d.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" )
endif ( )
2019-10-08 01:35:13 +08:00
2023-05-12 01:03:00 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share" )
2019-10-08 01:35:13 +08:00
2024-11-01 15:48:41 +08:00
set ( SHOULD_REMOVE_SFML_ALL 0 )
if ( NOT "audio" IN_LIST FEATURES )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sfml-audio.pc" )
set ( SHOULD_REMOVE_SFML_ALL 1 )
endif ( )
if ( NOT "graphics" IN_LIST FEATURES )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sfml-graphics.pc" )
set ( SHOULD_REMOVE_SFML_ALL 1 )
endif ( )
if ( NOT "network" IN_LIST FEATURES )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sfml-network.pc" )
set ( SHOULD_REMOVE_SFML_ALL 1 )
endif ( )
if ( NOT "window" IN_LIST FEATURES )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sfml-window.pc" )
set ( SHOULD_REMOVE_SFML_ALL 1 )
endif ( )
if ( SHOULD_REMOVE_SFML_ALL )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sfml-all.pc" )
endif ( )
2022-01-26 14:49:34 +08:00
vcpkg_fixup_pkgconfig ( )
2023-05-12 01:03:00 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/license.md" )