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-09-10 11:29:05 +08:00
S H A 5 1 2 6 5 c 9 7 2 0 9 8 c b e 3 a 7 d e d e 6 b a 1 0 6 c 6 6 7 8 5 0 2 b 1 0 a d 9 3 d 2 f 1 a 9 8 0 c c 9 9 7 a 1 f a c c 1 1 b 2 1 1 b c 5 6 4 a d 4 e f 8 1 0 2 4 8 c c 6 3 e 0 1 a 9 a d c 6 d e 2 3 6 9 9 a 2 4 5 c d a a 8 d f 8 9 c 7 f b 2 d 7 0 c 2 9 a 5 e
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
2024-07-10 21:54:33 +08:00
c x x - l i n k a g e - p k g c o n f i g . d i f f
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
2024-08-29 15:17:29 +08:00
d b u s S D L _ D B U S
2023-10-17 01:48:03 +08:00
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
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
2024-07-10 21:54:33 +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
- 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
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 } )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main" IGNORE_UNCHANGED )
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}" )
2024-07-10 21:54:33 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug" AND NOT VCPKG_TARGET_IS_ANDROID )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2main" "-lSDL2maind" IGNORE_UNCHANGED )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d " IGNORE_UNCHANGED )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2-static " "-lSDL2-staticd " IGNORE_UNCHANGED )
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" )