2020-08-08 06:38:18 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2024-09-17 03:22:06 +08:00
|
|
|
REPO strukturag/libheif
|
2023-04-26 13:41:32 +08:00
|
|
|
REF "v${VERSION}"
|
2024-09-17 03:22:06 +08:00
|
|
|
SHA512 0fcb6340694d5f30a355a0e1224bdbcb35d898594739ffd767cc882842887011a418aa67df08b8cdccc06fa2e477768de90704c8d6f5a827f6878252a13c7734
|
2020-08-08 06:38:18 +08:00
|
|
|
HEAD_REF master
|
2021-05-21 15:31:48 +08:00
|
|
|
PATCHES
|
|
|
|
gdk-pixbuf.patch
|
2020-08-08 06:38:18 +08:00
|
|
|
)
|
|
|
|
|
2024-02-24 07:00:28 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2024-09-17 03:22:06 +08:00
|
|
|
FEATURES
|
|
|
|
hevc WITH_X265
|
2024-02-24 07:00:28 +08:00
|
|
|
)
|
|
|
|
|
2021-10-27 14:42:55 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-11-21 03:48:17 +08:00
|
|
|
OPTIONS
|
|
|
|
-DWITH_EXAMPLES=OFF
|
2021-05-21 15:31:48 +08:00
|
|
|
-DWITH_DAV1D=OFF
|
2024-02-24 07:00:28 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2020-08-08 06:38:18 +08:00
|
|
|
)
|
2021-10-27 14:42:55 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-05-08 06:27:34 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-10-27 14:42:55 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libheif/)
|
2021-12-01 03:50:56 +08:00
|
|
|
# libheif's pc file assumes libstdc++, which isn't always true.
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libheif.pc" " -lstdc++" "" IGNORE_UNCHANGED)
|
2021-12-01 03:50:56 +08:00
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libheif.pc" " -lstdc++" "" IGNORE_UNCHANGED)
|
2021-12-01 03:50:56 +08:00
|
|
|
endif()
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-05-08 06:27:34 +08:00
|
|
|
|
2022-01-29 03:04:15 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2022-07-29 13:19:42 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libheif/heif.h" "defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD)" "defined(_WIN32)")
|
2022-01-29 03:04:15 +08:00
|
|
|
else()
|
2022-07-29 13:19:42 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libheif/heif.h" "defined(_MSC_VER) && !defined(LIBHEIF_STATIC_BUILD)" "0")
|
2022-01-29 03:04:15 +08:00
|
|
|
endif()
|
2022-07-29 13:19:42 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libheif/heif.h" "#ifdef LIBHEIF_EXPORTS" "#if 0")
|
2022-01-29 03:04:15 +08:00
|
|
|
|
2020-08-08 06:38:18 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2022-09-07 02:22:54 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2023-01-09 17:10:09 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/libheif" "${CURRENT_PACKAGES_DIR}/debug/lib/libheif")
|
2020-08-08 06:38:18 +08:00
|
|
|
|
2023-01-12 15:19:15 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libheif/heif_version.h" "#define LIBHEIF_PLUGIN_DIRECTORY \"${CURRENT_PACKAGES_DIR}/lib/libheif\"" "")
|
|
|
|
|
2023-04-26 13:41:32 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|