mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 04:43:18 +08:00
[harfbuzz] Fix CMake config (#25092)
* Use 'supports' to restrict 'coretext' * Minor portfile changes * Minimal fix to harfbuzzConfig.cmake * Update versions
This commit is contained in:
parent
7a199e7786
commit
5d992a46de
@ -1,11 +1,21 @@
|
||||
# For old projects where the minimum CMake version is lower than 3.3.
|
||||
cmake_policy(SET CMP0012 NEW)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
cmake_policy(SET CMP0057 NEW)
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# Traditional find module variables (vcpkg polyfill)
|
||||
set(HARFBUZZ_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/harfbuzz" CACHE INTERNAL "")
|
||||
set(HARFBUZZ_INCLUDE_DIRS "${HARFBUZZ_INCLUDE_DIR}")
|
||||
set(HARFBUZZ_LIBRARY harfbuzz::harfbuzz CACHE INTERNAL "")
|
||||
set(HARFBUZZ_LIBRARIES harfbuzz::harfbuzz)
|
||||
|
||||
if(TARGET harfbuzz)
|
||||
return()
|
||||
set(HARFBUZZ_FOUND TRUE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
add_library(harfbuzz INTERFACE IMPORTED GLOBAL)
|
||||
add_library(harfbuzz::harfbuzz ALIAS harfbuzz)
|
||||
|
||||
@ -56,16 +66,4 @@ if ("icu" IN_LIST HARFBUZZ_FEATURES)
|
||||
target_link_libraries(harfbuzz INTERFACE ICU::uc)
|
||||
endif()
|
||||
|
||||
get_filename_component(_INSTALL_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)
|
||||
target_include_directories(harfbuzz INTERFACE "${_INSTALL_DIR}/include/harfbuzz")
|
||||
|
||||
set(HARFBUZZ_LIBRARY harfbuzz::harfbuzz PARENT_SCOPE)
|
||||
set(HARFBUZZ_LIBRARIES harfbuzz::harfbuzz PARENT_SCOPE)
|
||||
set(HARFBUZZ_INCLUDE_DIR "${_INSTALL_DIR}/include/harfbuzz" PARENT_SCOPE)
|
||||
set(HARFBUZZ_INCLUDE_DIRS "${_INSTALL_DIR}/include/harfbuzz" PARENT_SCOPE)
|
||||
|
||||
if(HARFBUZZ_LIBRARY_RELEASE)
|
||||
set(HARFBUZZ_FOUND TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(HARFBUZZ_FOUND FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
target_include_directories(harfbuzz INTERFACE "${HARFBUZZ_INCLUDE_DIR}")
|
||||
|
@ -18,9 +18,6 @@ else()
|
||||
endif()
|
||||
if("coretext" IN_LIST FEATURES)
|
||||
list(APPEND FEATURE_OPTIONS -Dcoretext=enabled) # Enable CoreText shaper backend on macOS
|
||||
if(NOT VCPKG_TARGET_IS_OSX)
|
||||
message(FATAL_ERROR "Feature 'coretext' os only available on OSX")
|
||||
endif()
|
||||
else()
|
||||
list(APPEND FEATURE_OPTIONS -Dcoretext=disabled)
|
||||
endif()
|
||||
@ -39,8 +36,9 @@ list(APPEND FEATURE_OPTIONS -Dfreetype=enabled) #Enable freetype interop helpers
|
||||
|
||||
|
||||
vcpkg_configure_meson(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-Dcairo=disabled # Use Cairo graphics library
|
||||
-Dintrospection=disabled # Generate gobject-introspection bindings (.gir/.typelib files)
|
||||
-Ddocs=disabled # Generate documentation with gtk-doc
|
||||
@ -76,11 +74,9 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake")
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/harfbuzzConfig.cmake.in"
|
||||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/harfbuzzConfig.cmake" @ONLY)
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
vcpkg_list(SET TOOL_NAMES)
|
||||
if("glib" IN_LIST FEATURES)
|
||||
list(APPEND TOOL_NAMES hb-subset hb-shape hb-ot-shape-closure)
|
||||
vcpkg_list(APPEND TOOL_NAMES hb-subset hb-shape hb-ot-shape-closure)
|
||||
endif()
|
||||
if(TOOL_NAMES)
|
||||
vcpkg_copy_tools(TOOL_NAMES ${TOOL_NAMES} AUTO_CLEAN)
|
||||
@ -89,3 +85,5 @@ endif()
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "harfbuzz",
|
||||
"version": "4.2.0",
|
||||
"port-version": 1,
|
||||
"description": "HarfBuzz OpenType text shaping engine",
|
||||
"homepage": "https://github.com/harfbuzz/harfbuzz",
|
||||
"license": "MIT-Modern-Variant",
|
||||
@ -20,7 +21,8 @@
|
||||
],
|
||||
"features": {
|
||||
"coretext": {
|
||||
"description": "Enable CoreText shaper backend on macOS"
|
||||
"description": "Enable CoreText shaper backend on macOS",
|
||||
"supports": "osx"
|
||||
},
|
||||
"glib": {
|
||||
"description": "Glib Unicode callbacks support",
|
||||
|
@ -2750,7 +2750,7 @@
|
||||
},
|
||||
"harfbuzz": {
|
||||
"baseline": "4.2.0",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"hash-library": {
|
||||
"baseline": "8",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "aa86b69179481aee3a47cb7452a7058a65e6da0c",
|
||||
"version": "4.2.0",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "02ad2865be7815604bb2c0e6cbc368f3d23d93d6",
|
||||
"version": "4.2.0",
|
||||
|
Loading…
Reference in New Issue
Block a user