2021-08-19 08:19:15 +08:00
vcpkg_from_github (
2018-01-17 06:13:15 +08:00
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
2021-08-19 08:19:15 +08:00
R E P O l i b s d l - o r g / S D L
2023-03-08 04:18:34 +08:00
R E F " r e l e a s e - $ { V E R S I O N } "
2024-06-04 13:07:22 +08:00
S H A 5 1 2 3 a 7 c 6 c 0 5 1 5 2 0 5 3 3 8 a 0 2 3 a d a 2 3 0 1 2 8 e 6 5 8 f 4 e c f f 3 c c d 3 7 1 d 3 3 c d 9 b b 8 2 e b 4 9 9 2 d b 9 7 2 2 4 1 f a f 4 4 f 3 2 5 f 7 d 5 3 6 c 7 d e d b 0 a 0 2 e e 1 5 7 4 b 7 a 8 4 b a 3 c 9 8 5 6 c a e 9 e 6 d 2 5 b d b d c
2022-11-03 05:12:36 +08:00
H E A D _ R E F m a i n
2022-12-27 16:52:33 +08:00
P A T C H E S
d e p s . p a t c h
2023-08-29 04:24:36 +08:00
a l s a - d e p - f i x . p a t c h
2016-12-29 08:00:43 +08:00
)
2017-11-22 18:56:43 +08:00
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC )
string ( COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SDL_SHARED )
string ( COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT )
2016-09-19 11:50:08 +08:00
2020-03-03 02:05:47 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-04-08 03:31:03 +08:00
F E A T U R E S
2023-10-17 01:48:03 +08:00
a l s a S D L _ A L S A
a l s a C M A K E _ R E Q U I R E _ F I N D _ P A C K A G E _ A L S A
i b u s S D L _ I B U S
s a m p l e r a t e S D L _ L I B S A M P L E R A T E
2022-08-11 07:08:17 +08:00
v u l k a n S D L _ V U L K A N
2022-11-29 03:12:32 +08:00
w a y l a n d S D L _ W A Y L A N D
2023-10-17 01:48:03 +08:00
x 1 1 S D L _ X 1 1
I N V E R T E D _ F E A T U R E S
a l s a C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ A L S A
2020-03-03 02:05:47 +08:00
)
2019-02-27 03:08:53 +08:00
2021-11-12 05:47:51 +08:00
if ( "x11" IN_LIST FEATURES )
message ( WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n" )
endif ( )
2022-08-11 07:08:17 +08:00
if ( "wayland" IN_LIST FEATURES )
message ( WARNING "You will need to install Wayland dependencies to use feature wayland:\nsudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev\n" )
endif ( )
2023-02-14 00:41:32 +08:00
if ( "ibus" IN_LIST FEATURES )
message ( WARNING "You will need to install ibus dependencies to use feature ibus:\nsudo apt install libibus-1.0-dev\n" )
endif ( )
2021-11-12 05:47:51 +08:00
2022-04-28 09:12:48 +08:00
if ( VCPKG_TARGET_IS_UWP )
set ( configure_opts WINDOWS_USE_MSBUILD )
endif ( )
2021-11-12 05:47:51 +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 } "
2022-04-28 09:12:48 +08:00
$ { c o n f i g u r e _ o p t s }
2020-03-03 02:05:47 +08:00
O P T I O N S $ { F E A T U R E _ O P T I O N S }
2017-11-22 18:56:43 +08:00
- D S D L _ S T A T I C = $ { S D L _ S T A T I C }
- D S D L _ S H A R E D = $ { S D L _ S H A R E D }
2022-01-27 07:32:31 +08:00
- D S D L _ F O R C E _ S T A T I C _ V C R T = $ { F O R C E _ S T A T I C _ V C R T }
- D S D L _ L I B C = O N
2022-09-01 04:34:35 +08:00
- D S D L _ T E S T = O F F
2022-11-29 03:12:32 +08:00
- D S D L _ I N S T A L L _ C M A K E D I R = " c m a k e "
2022-12-27 16:52:33 +08:00
- D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ G i t = O N
2023-09-29 14:22:37 +08:00
- D P K G _ C O N F I G _ U S E _ C M A K E _ P R E F I X _ P A T H = O N
2022-12-27 16:52:33 +08:00
- D S D L _ L I B S A M P L E R A T E _ S H A R E D = O F F
2022-09-01 04:34:35 +08:00
M A Y B E _ U N U S E D _ V A R I A B L E S
S D L _ F O R C E _ S T A T I C _ V C R T
2023-10-11 06:01:31 +08:00
P K G _ C O N F I G _ U S E _ C M A K E _ P R E F I X _ P A T H
2017-11-22 18:56:43 +08:00
)
2016-09-19 11:50:08 +08:00
2021-11-12 05:47:51 +08:00
vcpkg_cmake_install ( )
2022-11-29 03:12:32 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH cmake )
2018-03-12 14:41:51 +08:00
file ( REMOVE_RECURSE
2021-11-12 05:47:51 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / b i n / s d l 2 - c o n f i g "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n / s d l 2 - c o n f i g "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / S D L 2 . f r a m e w o r k "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / S D L 2 . f r a m e w o r k "
2022-12-27 16:52:33 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / l i c e n s e s "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / a c l o c a l "
2018-03-12 14:41:51 +08:00
)
2016-09-19 11:50:08 +08:00
2021-11-12 05:47:51 +08:00
file ( GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*" )
2018-03-12 14:41:51 +08:00
if ( NOT BINS )
file ( REMOVE_RECURSE
2021-11-12 05:47:51 +08:00
" $ { C U R R E N T _ P A C K A G E S _ D I R } / b i n "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n "
2018-03-12 14:41:51 +08:00
)
endif ( )
2017-11-21 09:06:11 +08:00
2021-12-02 11:20:14 +08:00
if ( VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP AND NOT VCPKG_TARGET_IS_MINGW )
2018-03-20 03:15:56 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
2021-11-12 05:47:51 +08:00
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib" )
2018-03-20 03:15:56 +08:00
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
2021-11-12 05:47:51 +08:00
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib" )
2018-03-20 03:15:56 +08:00
endif ( )
2017-11-21 09:06:11 +08:00
2021-11-12 05:47:51 +08:00
file ( GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake" )
2017-11-21 09:06:11 +08:00
foreach ( SHARE_FILE ${ SHARE_FILES } )
2021-01-25 15:21:41 +08:00
vcpkg_replace_string ( "${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main" )
2017-11-21 09:06:11 +08:00
endforeach ( )
2017-09-24 20:31:30 +08:00
endif ( )
2016-12-11 21:04:59 +08:00
2016-09-19 11:50:08 +08:00
vcpkg_copy_pdbs ( )
2020-08-19 03:58:14 +08:00
set ( DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)" )
set ( DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)" )
file ( STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${ DYLIB_COMPATIBILITY_VERSION_REGEX } )
file ( STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${ DYLIB_CURRENT_VERSION_REGEX } )
string ( REGEX REPLACE ${ DYLIB_COMPATIBILITY_VERSION_REGEX } "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}" )
string ( REGEX REPLACE ${ DYLIB_CURRENT_VERSION_REGEX } "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}" )
2020-10-08 02:47:58 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
2021-01-25 15:21:41 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d " )
2022-11-29 03:12:32 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-static " "-lSDL2-staticd " )
2020-10-08 02:47:58 +08:00
endif ( )
2020-08-19 03:58:14 +08:00
2022-11-29 03:12:32 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-lSDL2-static " " " )
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-staticd " " " )
endif ( )
endif ( )
if ( VCPKG_TARGET_IS_UWP )
2022-09-01 04:34:35 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release" )
2022-11-29 03:12:32 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:" )
2022-09-01 04:34:35 +08:00
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" )
2022-11-29 03:12:32 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "$<$<CONFIG:Debug>:d>.lib" "d" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-l-nodefaultlib:" "-nodefaultlib:" )
2022-09-01 04:34:35 +08:00
endif ( )
endif ( )
2022-03-22 10:44:39 +08:00
vcpkg_fixup_pkgconfig ( )
2022-04-16 04:44:08 +08:00
2022-11-03 05:12:36 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
2022-11-29 03:12:32 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/LICENSE.txt" )