vcpkg/ports/sail/portfile.cmake

60 lines
2.2 KiB
CMake
Raw Normal View History

2020-12-12 06:17:43 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO HappySeaFox/sail
REF v0.9.0-rc3
SHA512 5de94277d57b862d4ab99266c2608cd37d7ca9eb89ef753ddddf47e4cebffab54b2cfb9c28d0c3bb7721f0d24c1310377c4b42adab477568e6965bd7ebc55b17
2020-12-12 06:17:43 +08:00
HEAD_REF master
)
# Enable selected codecs
set(ONLY_CODECS "")
foreach(CODEC avif bmp gif ico jpeg jpeg2000 pcx png psd qoi tga tiff wal webp xbm)
if (${CODEC} IN_LIST FEATURES)
list(APPEND ONLY_CODECS ${CODEC})
endif()
endforeach()
list(JOIN ONLY_CODECS "\;" ONLY_CODECS_ESCAPED)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2020-12-12 06:17:43 +08:00
OPTIONS
-DSAIL_COMBINE_CODECS=ON
-DSAIL_ONLY_CODECS=${ONLY_CODECS_ESCAPED}
-DSAIL_BUILD_APPS=OFF
2020-12-12 06:17:43 +08:00
-DSAIL_BUILD_EXAMPLES=OFF
-DSAIL_BUILD_TESTS=OFF
)
vcpkg_cmake_install()
2020-12-12 06:17:43 +08:00
vcpkg_copy_pdbs()
# Remove duplicate files
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share")
2020-12-12 06:17:43 +08:00
# Move cmake configs
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()
2022-01-05 11:48:02 +08:00
# Unused because SAIL_COMBINE_CODECS is On
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/sail/sail-common/config.h" "#define SAIL_CODECS_PATH \"${CURRENT_PACKAGES_DIR}/lib/sail/codecs\"" "")
2020-12-12 06:17:43 +08:00
# Handle usage
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2020-12-12 06:17:43 +08:00
# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")