2016-10-08 03:09:58 +08:00
|
|
|
include(vcpkg_common_functions)
|
2018-01-01 16:19:40 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2018-08-12 13:47:01 +08:00
|
|
|
REPO harfbuzz/harfbuzz
|
2019-03-13 04:54:20 +08:00
|
|
|
REF 2.3.1
|
|
|
|
SHA512 c90f8a530bf49e91f5297f6a3c2f4be65f8907e3b41892cd5fbc1353ce7036aae7e182bfd0ea8cb32b0310cbe7284a3de8b6622e08db9736c3f0bba6cb1f9f01
|
2018-01-01 16:19:40 +08:00
|
|
|
HEAD_REF master
|
2018-01-19 02:45:34 +08:00
|
|
|
PATCHES
|
2018-09-18 14:48:30 +08:00
|
|
|
0001-fix-cmake-export.patch
|
2019-03-13 04:54:20 +08:00
|
|
|
0002-fix-uwp-build.patch
|
2019-03-14 21:33:48 +08:00
|
|
|
0003-remove-broken-test.patch
|
2019-03-16 13:08:07 +08:00
|
|
|
# This patch is required for propagating the full list of static dependencies from freetype
|
|
|
|
find-package-freetype-2.patch
|
|
|
|
# This patch is required for propagating the full list of dependencies from glib
|
|
|
|
glib-cmake.patch
|
2017-05-29 17:26:27 +08:00
|
|
|
)
|
|
|
|
|
2019-03-16 13:08:07 +08:00
|
|
|
file(READ ${SOURCE_PATH}/CMakeLists.txt _contents)
|
|
|
|
if("${_contents}" MATCHES "include \\(FindFreetype\\)")
|
|
|
|
message(FATAL_ERROR "Harfbuzz's cmake must not directly include() FindFreetype.")
|
|
|
|
endif()
|
|
|
|
if("${_contents}" MATCHES "find_library\\(GLIB_LIBRARIES")
|
|
|
|
message(FATAL_ERROR "Harfbuzz's cmake must not directly find_library() glib.")
|
|
|
|
endif()
|
|
|
|
|
2018-07-03 21:24:02 +08:00
|
|
|
SET(HB_HAVE_ICU "OFF")
|
|
|
|
if("icu" IN_LIST FEATURES)
|
|
|
|
SET(HB_HAVE_ICU "ON")
|
|
|
|
endif()
|
|
|
|
|
2018-08-22 08:07:53 +08:00
|
|
|
SET(HB_HAVE_GRAPHITE2 "OFF")
|
|
|
|
if("graphite2" IN_LIST FEATURES)
|
|
|
|
SET(HB_HAVE_GRAPHITE2 "ON")
|
|
|
|
endif()
|
|
|
|
|
2018-07-04 22:08:45 +08:00
|
|
|
## Unicode callbacks
|
|
|
|
|
|
|
|
# Builtin (UCDN)
|
|
|
|
set(BUILTIN_UCDN OFF)
|
|
|
|
if("ucdn" IN_LIST FEATURES)
|
|
|
|
set(BUILTIN_UCDN ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Glib
|
|
|
|
set(HAVE_GLIB OFF)
|
|
|
|
if("glib" IN_LIST FEATURES)
|
|
|
|
set(HAVE_GLIB ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# At least one Unicode callback must be specified, or harfbuzz compilation fails
|
|
|
|
if(NOT (BUILTIN_UCDN OR HAVE_GLIB))
|
|
|
|
message(FATAL_ERROR "Error: At least one Unicode callback must be specified (ucdn, glib).")
|
2017-05-29 17:26:27 +08:00
|
|
|
endif()
|
|
|
|
|
2017-04-15 20:39:04 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
-DHB_HAVE_FREETYPE=ON
|
2017-05-29 17:26:27 +08:00
|
|
|
-DHB_BUILTIN_UCDN=${BUILTIN_UCDN}
|
2018-07-03 21:24:02 +08:00
|
|
|
-DHB_HAVE_ICU=${HB_HAVE_ICU}
|
2018-07-04 22:08:45 +08:00
|
|
|
-DHB_HAVE_GLIB=${HAVE_GLIB}
|
2018-08-22 08:07:53 +08:00
|
|
|
-DHB_HAVE_GRAPHITE2=${HB_HAVE_GRAPHITE2}
|
2019-03-13 04:54:20 +08:00
|
|
|
-DHB_BUILD_TESTS=OFF
|
2017-04-15 20:39:04 +08:00
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSKIP_INSTALL_HEADERS=ON
|
2016-10-08 03:09:58 +08:00
|
|
|
)
|
|
|
|
|
2017-04-15 20:39:04 +08:00
|
|
|
vcpkg_install_cmake()
|
2018-10-09 20:05:08 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH share/harfbuzz TARGET_PATH share/harfbuzz)
|
2017-04-15 20:39:04 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2017-01-26 18:25:24 +08:00
|
|
|
|
2016-10-08 03:09:58 +08:00
|
|
|
# Handle copyright
|
2019-03-13 04:54:20 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz RENAME copyright)
|
2018-09-18 14:48:30 +08:00
|
|
|
|
2018-10-09 20:05:08 +08:00
|
|
|
vcpkg_test_cmake(PACKAGE_NAME harfbuzz)
|