2020-12-12 06:17:43 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2021-09-10 12:17:59 +08:00
|
|
|
REPO HappySeaFox/sail
|
2023-11-09 01:43:44 +08:00
|
|
|
REF "v${VERSION}"
|
2024-10-02 22:05:36 +08:00
|
|
|
SHA512 7c6af5a381535515882dbbecf988a3cb10d2859e71084b8c9eeefac8a546df38c1438ac741535db668e8a6da09185e04ef016f71dffec297d4f5a8764653dff8
|
2020-12-12 06:17:43 +08:00
|
|
|
HEAD_REF master
|
2024-04-04 07:16:36 +08:00
|
|
|
PATCHES
|
|
|
|
fix-include-directory.patch
|
2020-12-12 06:17:43 +08:00
|
|
|
)
|
|
|
|
|
2022-10-14 02:59:21 +08:00
|
|
|
# Enable selected codecs
|
|
|
|
set(ONLY_CODECS "")
|
|
|
|
|
2024-01-17 02:53:23 +08:00
|
|
|
foreach(CODEC avif bmp gif ico jpeg jpeg2000 jpegxl pcx png psd qoi svg tga tiff wal webp xbm)
|
2022-10-14 02:59:21 +08:00
|
|
|
if (${CODEC} IN_LIST FEATURES)
|
|
|
|
list(APPEND ONLY_CODECS ${CODEC})
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
list(JOIN ONLY_CODECS "\;" ONLY_CODECS_ESCAPED)
|
|
|
|
|
2024-01-17 02:53:23 +08:00
|
|
|
# Enable OpenMP
|
|
|
|
if ("openmp" IN_LIST FEATURES)
|
|
|
|
set(SAIL_ENABLE_OPENMP ON)
|
|
|
|
endif()
|
|
|
|
|
2021-07-27 01:57:24 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-12-12 06:17:43 +08:00
|
|
|
OPTIONS
|
2023-11-09 01:43:44 +08:00
|
|
|
-DBUILD_TESTING=OFF
|
2020-12-30 11:26:27 +08:00
|
|
|
-DSAIL_COMBINE_CODECS=ON
|
2024-01-17 02:53:23 +08:00
|
|
|
-DSAIL_ENABLE_OPENMP=${SAIL_ENABLE_OPENMP}
|
2022-10-14 02:59:21 +08:00
|
|
|
-DSAIL_ONLY_CODECS=${ONLY_CODECS_ESCAPED}
|
2021-10-27 14:55:40 +08:00
|
|
|
-DSAIL_BUILD_APPS=OFF
|
2020-12-12 06:17:43 +08:00
|
|
|
-DSAIL_BUILD_EXAMPLES=OFF
|
|
|
|
)
|
|
|
|
|
2021-07-27 01:57:24 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-12-12 06:17:43 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
# Remove duplicate files
|
2022-09-16 03:31:18 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share")
|
2020-12-12 06:17:43 +08:00
|
|
|
|
|
|
|
# Move cmake configs
|
2021-07-27 01:57:24 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sail CONFIG_PATH lib/cmake/sail DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sailcodecs CONFIG_PATH lib/cmake/sailcodecs DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sailcommon CONFIG_PATH lib/cmake/sailcommon DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sailc++ CONFIG_PATH lib/cmake/sailc++ DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME sailmanip CONFIG_PATH lib/cmake/sailmanip DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/lib/cmake")
|
|
|
|
|
2020-12-12 06:17:43 +08:00
|
|
|
|
|
|
|
# Fix pkg-config files
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2024-06-20 05:07:05 +08:00
|
|
|
# Unused because SAIL_COMBINE_CODECS is ON, removes an absolute path from the output
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sail-common/config.h" "#define SAIL_CODECS_PATH [^\r\n]+[\r\n]*" "" REGEX)
|
2022-01-05 11:48:02 +08:00
|
|
|
|
2020-12-12 06:17:43 +08:00
|
|
|
# Handle usage
|
2021-07-27 01:57:24 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
|
2020-12-12 06:17:43 +08:00
|
|
|
# Handle copyright
|
2023-03-20 14:32:09 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|