2017-04-23 22:30:22 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2019-06-19 02:18:37 +08:00
|
|
|
set(GM_VERSION 1.3.32)
|
2017-04-23 22:30:22 +08:00
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-08-05 08:32:46 +08:00
|
|
|
URLS "https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/${GM_VERSION}/GraphicsMagick-${GM_VERSION}-windows-source.7z"
|
|
|
|
FILENAME "GraphicsMagick-${GM_VERSION}-windows-source.7z"
|
2019-06-19 02:18:37 +08:00
|
|
|
SHA512 1636f704bac65587d6526a10e7002a6158f951643a4e9eb936b0b734c1eb187155aa4d67febe897f9a2397ecadff736ba84cfe21704348e2d8481af01eff02f6
|
2018-09-05 07:20:46 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF "${GM_VERSION}"
|
|
|
|
PATCHES
|
|
|
|
# GM always requires a dynamic BZIP2. This patch makes this dependent if _DLL is defined
|
|
|
|
dynamic_bzip2.patch
|
|
|
|
|
|
|
|
# Bake GM's own modules into the .dll itself. This fixes a bug whereby
|
|
|
|
# 'vcpkg install graphicsmagick' did not lead to a copy of GM that could
|
|
|
|
# load either PNG or JPEG files (due to missing GM Modules, with names
|
|
|
|
# matching "IM_*.DLL").
|
|
|
|
disable_graphicsmagick_modules.patch
|
|
|
|
)
|
2017-04-23 22:30:22 +08:00
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
2017-08-05 08:32:46 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/magick_types.h DESTINATION ${SOURCE_PATH}/magick)
|
2017-04-23 22:30:22 +08:00
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-09-05 07:20:46 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DINSTALL_HEADERS=OFF
|
2017-04-23 22:30:22 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-graphicsmagick TARGET_PATH share/unofficial-graphicsmagick)
|
|
|
|
|
2017-04-23 22:30:22 +08:00
|
|
|
# copy license
|
|
|
|
file(COPY ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphicsmagick)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/Copyright.txt ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/copyright)
|
|
|
|
|
|
|
|
# copy config
|
|
|
|
file(COPY ${SOURCE_PATH}/config/colors.mgk DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config)
|
|
|
|
file(COPY ${SOURCE_PATH}/config/log.mgk DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config)
|
|
|
|
file(COPY ${SOURCE_PATH}/config/modules.mgk DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config)
|
|
|
|
|
|
|
|
file(READ ${SOURCE_PATH}/config/type-windows.mgk.in TYPE_MGK)
|
|
|
|
string(REPLACE "@windows_font_dir@" "$ENV{SYSTEMROOT}/Fonts/" TYPE_MGK "${TYPE_MGK}")
|
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/graphicsmagick/config/type.mgk "${TYPE_MGK}")
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
2018-09-12 04:11:51 +08:00
|
|
|
|
|
|
|
vcpkg_test_cmake(PACKAGE_NAME unofficial-graphicsmagick)
|