2017-01-20 01:06:42 +08:00
|
|
|
|
|
|
|
include(vcpkg_common_functions)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
2017-07-13 02:16:56 +08:00
|
|
|
set(FONTCONFIG_VERSION 2.12.4)
|
2017-01-20 01:06:42 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2017-05-31 23:43:19 +08:00
|
|
|
URLS "https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz"
|
|
|
|
FILENAME "fontconfig-${FONTCONFIG_VERSION}.tar.gz"
|
2018-09-12 04:11:51 +08:00
|
|
|
SHA512 2be3ee0e8e0e3b62571135a3cae06e456c289dd1ad40ef2a7c780406418ee5efce863a833eca5a8ef55bc737a0ea04ef562bba6fd27e174ae43e42131b52810d
|
|
|
|
)
|
2018-06-15 02:43:53 +08:00
|
|
|
|
2018-09-12 04:11:51 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
REF ${FONTCONFIG_VERSION}
|
|
|
|
PATCHES fcobjtypehash.patch
|
2018-06-15 02:43:53 +08:00
|
|
|
)
|
|
|
|
|
2017-01-20 01:06:42 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2017-05-31 23:43:19 +08:00
|
|
|
PREFER_NINJA
|
2017-01-20 01:06:42 +08:00
|
|
|
OPTIONS
|
|
|
|
-DFC_INCLUDE_DIR=${CMAKE_CURRENT_LIST_DIR}/include
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DFC_SKIP_TOOLS=ON
|
2018-06-15 02:43:53 +08:00
|
|
|
-DFC_SKIP_HEADERS=ON
|
|
|
|
)
|
2017-01-20 01:06:42 +08:00
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
2018-09-12 04:11:51 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-fontconfig TARGET_PATH share/unofficial-fontconfig)
|
|
|
|
|
2017-01-20 01:06:42 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2017-05-31 23:43:19 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
foreach(HEADER fcfreetype.h fontconfig.h)
|
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} FC_HEADER)
|
2019-03-16 02:12:55 +08:00
|
|
|
if(WIN32)
|
|
|
|
string(REPLACE "#define FcPublic" "#define FcPublic __declspec(dllimport)" FC_HEADER "${FC_HEADER}")
|
|
|
|
else()
|
|
|
|
string(REPLACE "#define FcPublic" "#define FcPublic __attribute__((visibility(\"default\")))" FC_HEADER "${FC_HEADER}")
|
|
|
|
endif()
|
2017-05-31 23:43:19 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/include/fontconfig/${HEADER} "${FC_HEADER}")
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
|
2017-01-20 01:06:42 +08:00
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/fontconfig)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/fontconfig/COPYING ${CURRENT_PACKAGES_DIR}/share/fontconfig/copyright)
|
2018-09-12 04:11:51 +08:00
|
|
|
|
|
|
|
vcpkg_test_cmake(PACKAGE_NAME unofficial-fontconfig)
|