2022-01-27 07:32:31 +08:00
set ( SDL2_VERSION 2.0.20 )
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
2022-05-16 12:21:02 +08:00
R E F 5 3 d e a 9 8 3 0 9 6 4 e e e 8 b 5 c 2 a 7 e e 0 a 6 5 d 6 e 2 6 8 d c 7 8 a 1 #vrelease-2.0.22
S H A 5 1 2 8 0 9 a c 1 8 a e b 7 3 9 c f c 6 5 5 8 d c 1 1 a 7 b 3 a b b d a d 6 2 a 8 e 6 5 1 a e 2 b f c 1 5 7 f 2 6 9 4 7 b 0 d f 0 6 3 a 3 4 c 1 1 7 e a 8 b d 0 0 3 4 2 8 b 5 6 1 8 f a 6 c e 2 1 a 6 5 5 f d a 0 7 3 f 1 e f 1 5 a a 3 4 b c 4 a 4 4 2 a 5 7 8 5 2 3
2021-08-19 08:19:15 +08:00
H E A D _ R E F m a s t e r
2016-12-29 08:00:43 +08:00
P A T C H E S
2021-01-06 04:33:13 +08:00
0 0 0 1 - s d l 2 - E n a b l e - c r e a t i o n - o f - p k g - c f g - f i l e - o n - w i n d o w s . p a t c h
0 0 0 2 - s d l 2 - s k i p - i b u s - o n - l i n u x . p a t c h
2021-08-19 08:19:15 +08:00
0 0 0 3 - s d l 2 - d i s a b l e - s d l m a i n - t a r g e t - s e a r c h - o n - u w p . p a t c h
2022-01-27 07:32:31 +08:00
0 0 0 4 - D e f i n e - c r t - m a c r o s . p a t c h
2022-08-03 13:58:29 +08:00
0 0 0 5 - e m s c r i p t e n - f i x - u n d e f i n e d - s y m b o l - e r r o r s - i n - n o n - t h r e a d e d . 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
2022-08-11 07:08:17 +08:00
v u l k a n S D L _ V U L K A N
x 1 1 S D L _ X 1 1 _ S H A R E D
w a y l a n d S D L _ W A Y L A N D _ S H A R E D
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 ( )
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-06-03 06:31:59 +08:00
- D S D L _ H I D A P I _ J O Y S T I C K = O N
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 ( )
2017-11-21 09:06:11 +08:00
2018-03-12 14:41:51 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/cmake" )
2021-11-12 05:47:51 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH cmake )
2018-03-12 14:41:51 +08:00
elseif ( EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/SDL2" )
2021-11-12 05:47:51 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/SDL2 )
2018-03-12 14:41:51 +08:00
elseif ( EXISTS "${CURRENT_PACKAGES_DIR}/SDL2.framework/Resources" )
2021-11-12 05:47:51 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH SDL2.framework/Resources )
2018-03-12 14:41:51 +08:00
endif ( )
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 "
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 " )
2020-10-08 02:47:58 +08:00
endif ( )
2020-08-19 03:58:14 +08:00
2022-03-22 10:44:39 +08:00
vcpkg_fixup_pkgconfig ( )
2022-04-16 04:44:08 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )