vcpkg/ports/sdl2-image/portfile.cmake
jim wang 086d63cc4e
[sdl2-image] Update to 2.8.2 (#36830)
Fixes https://github.com/microsoft/vcpkg/issues/36769
Removed `fix-pkgconfig.patch`.

- [X] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [X] SHA512s are updated for each updated download.
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version.~~
- [ ] ~~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~~
- [X] Any patches that are no longer applied are deleted from the port's
directory.
- [X] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [X] Only one version is added to each modified port's versions file.

All features passed with following triplets:

```
x86-windows
x64-windows
x64-windows-static
```
Usage test pass with following triplets:

```
x86-windows
x64-windows
x64-windows-static
```
2024-02-21 10:00:26 -08:00

52 lines
1.6 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsdl-org/SDL_image
REF "release-${VERSION}"
SHA512 1ec6e7d08bbcd28bba6c972b2e4a11a1da841abef3ffb3d29669b0f5eb0839f39044b0b334c0707274dd51192e081f25bdab97c6710d632422c4ed0274a30f18
HEAD_REF main
PATCHES
fix-findwebp.patch
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
libjpeg-turbo SDL2IMAGE_JPG
libwebp SDL2IMAGE_WEBP
tiff SDL2IMAGE_TIF
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DSDL2IMAGE_BACKEND_IMAGEIO=OFF
-DSDL2IMAGE_BACKEND_STB=OFF
-DSDL2IMAGE_DEPS_SHARED=OFF
-DSDL2IMAGE_SAMPLES=OFF
-DSDL2IMAGE_VENDORED=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_image CONFIG_PATH cmake)
elseif(EXISTS "${CURRENT_PACKAGES_DIR}/SDL2_image.framework/Resources")
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_image CONFIG_PATH SDL2_image.framework/Resources)
else()
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_image CONFIG_PATH lib/cmake/SDL2_image)
endif()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/SDL2_image.framework"
"${CURRENT_PACKAGES_DIR}/debug/SDL2_image.framework"
)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")