vcpkg/ports/libwebp/portfile.cmake
Lily Wang acc74b2d5b
[libwebp] Update to 1.4.0 (#38253)
Fixes #38227 
All features passed with following triplets:
```
x86-windows
x64-windows
x64-windows-static
```
Usage test passed on `x64-windows`.

- [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.

---------

Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
2024-04-19 07:39:52 -04:00

75 lines
2.4 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebp
REF "v${VERSION}"
SHA512 666b53fb33fa7895bf9dc83ca24e09865cf7fba7ae88b77f15a2ce11d94e84d5a6b8a084f0d8cad6c2a6eb8868ea7268f7efd2f6886148bbb58b7a3522957cde
HEAD_REF master
PATCHES
0002-cmake-config.patch
0003-simd.patch
0008-sdl.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
anim WEBP_BUILD_ANIM_UTILS
cwebp WEBP_BUILD_CWEBP
dwebp WEBP_BUILD_DWEBP
extras WEBP_BUILD_EXTRAS
gif2webp WEBP_BUILD_GIF2WEBP
img2webp WEBP_BUILD_IMG2WEBP
info WEBP_BUILD_WEBPINFO
libwebpmux WEBP_BUILD_LIBWEBPMUX
mux WEBP_BUILD_WEBPMUX
nearlossless WEBP_NEAR_LOSSLESS
simd WEBP_ENABLE_SIMD
swap16bitcsp WEBP_ENABLE_SWAP_16BIT_CSP
unicode WEBP_UNICODE
vwebp WEBP_BUILD_VWEBP
vwebp-sdl CMAKE_REQUIRE_FIND_PACKAGE_SDL
INVERTED_FEATURES
vwebp-sdl CMAKE_DISABLE_FIND_PACKAGE_SDL
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DWEBP_BUILD_ANIM_UTILS=OFF
-DWEBP_BUILD_CWEBP=OFF
-DWEBP_BUILD_DWEBP=OFF
-DWEBP_BUILD_EXTRAS=OFF
-DWEBP_BUILD_GIF2WEBP=OFF
-DWEBP_BUILD_IMG2WEBP=OFF
-DWEBP_BUILD_VWEBP=OFF
-DWEBP_BUILD_WEBPINFO=OFF
-DWEBP_BUILD_WEBPMUX=OFF
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_SDL
CMAKE_REQUIRE_FIND_PACKAGE_SDL
)
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME WebP CONFIG_PATH share/WebP/cmake)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_fixup_pkgconfig()
vcpkg_list(SET BIN_NAMES)
foreach(tool IN ITEMS get_disto gif2webp img2webp vwebp vwebp_sdl webpinfo webpmux webp_quality cwebp dwebp)
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
vcpkg_list(APPEND BIN_NAMES "${tool}")
endif()
endforeach()
if(NOT BIN_NAMES STREQUAL "")
vcpkg_copy_tools(TOOL_NAMES ${BIN_NAMES} AUTO_CLEAN)
endif()
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST ${SOURCE_PATH}/COPYING ${SOURCE_PATH}/PATENTS)