2019-05-18 15:45:53 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/zopfli
|
2020-03-17 05:52:12 +08:00
|
|
|
REF bd64b2f0553d4f1ef4e6627647c5d9fc8c71ffc0 # zopfli-1.0.3
|
|
|
|
SHA512 3c99a4cdf3b2f0b619944bf2173ded8e10a89271fc4b2c713378b85d976a8580d15a473d5b0e6229f2911908fb1cc7397e516d618e61831c3becd65623214d94
|
2019-05-18 15:45:53 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-05-18 15:45:53 +08:00
|
|
|
OPTIONS
|
|
|
|
-DZOPFLI_BUILD_INSTALL=ON
|
|
|
|
)
|
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-05-18 15:45:53 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
# Install tools
|
2022-07-19 04:10:46 +08:00
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
file(COPY "${CURRENT_PACKAGES_DIR}/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
|
|
|
|
|
|
|
file(REMOVE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/zopfli${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin/zopflipng${VCPKG_TARGET_EXECUTABLE_SUFFIX}"
|
|
|
|
)
|
2019-05-18 15:45:53 +08:00
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2019-05-18 15:45:53 +08:00
|
|
|
endif()
|
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/Zopfli")
|
2019-05-18 15:45:53 +08:00
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
# vcpkg_cmake_config_fixup can not handles this on UNIX currently.
|
2019-05-18 15:45:53 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
|
|
|
|
VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
2022-10-27 01:55:31 +08:00
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake"
|
|
|
|
"\"\${_IMPORT_PREFIX}/debug/bin/zopfli\""
|
|
|
|
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\""
|
|
|
|
)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-debug.cmake"
|
|
|
|
"\"\${_IMPORT_PREFIX}/debug/bin/zopflipng\""
|
|
|
|
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\""
|
|
|
|
)
|
|
|
|
endif()
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake"
|
2019-05-18 15:45:53 +08:00
|
|
|
"\"\${_IMPORT_PREFIX}/bin/zopfli\""
|
|
|
|
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopfli\""
|
|
|
|
)
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/zopfli/ZopfliConfig-release.cmake"
|
2019-05-18 15:45:53 +08:00
|
|
|
"\"\${_IMPORT_PREFIX}/bin/zopflipng\""
|
|
|
|
"\"\${_IMPORT_PREFIX}/tools/zopfli/zopflipng\""
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2019-05-18 15:45:53 +08:00
|
|
|
|
2022-07-19 04:10:46 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|