2021-08-10 00:04:09 +08:00
|
|
|
# For old projects where the minimum CMake version is lower than 3.3.
|
2022-06-09 06:44:40 +08:00
|
|
|
cmake_policy(SET CMP0012 NEW)
|
|
|
|
cmake_policy(SET CMP0054 NEW)
|
2021-08-10 00:04:09 +08:00
|
|
|
cmake_policy(SET CMP0057 NEW)
|
2022-06-09 06:44:40 +08:00
|
|
|
|
|
|
|
# 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)
|
2021-08-10 00:04:09 +08:00
|
|
|
|
2021-01-25 17:47:30 +08:00
|
|
|
if(TARGET harfbuzz)
|
2022-06-09 06:44:40 +08:00
|
|
|
set(HARFBUZZ_FOUND TRUE)
|
|
|
|
return()
|
2021-01-25 17:47:30 +08:00
|
|
|
endif()
|
|
|
|
|
2022-06-09 06:44:40 +08:00
|
|
|
include(CMakeFindDependencyMacro)
|
|
|
|
|
2021-01-25 17:47:30 +08:00
|
|
|
add_library(harfbuzz INTERFACE IMPORTED GLOBAL)
|
|
|
|
add_library(harfbuzz::harfbuzz ALIAS harfbuzz)
|
|
|
|
|
|
|
|
find_library(HARFBUZZ_LIBRARY_DEBUG NAMES harfbuzz PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
|
|
|
if(HARFBUZZ_LIBRARY_DEBUG)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<CONFIG:DEBUG>:${HARFBUZZ_LIBRARY_DEBUG}>)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(HARFBUZZ_LIBRARY_RELEASE NAMES harfbuzz PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
2022-02-24 03:57:13 +08:00
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${HARFBUZZ_LIBRARY_RELEASE}>)
|
2021-01-25 17:47:30 +08:00
|
|
|
|
|
|
|
set(HARFBUZZ_FEATURES @FEATURES@)
|
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices)
|
2022-11-10 02:36:22 +08:00
|
|
|
if(APPLICATIONSERVICES_LIBRARY)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE ${APPLICATIONSERVICES_LIBRARY})
|
|
|
|
endif()
|
2021-01-25 17:47:30 +08:00
|
|
|
endif()
|
|
|
|
|
2022-02-24 03:57:13 +08:00
|
|
|
find_dependency(freetype CONFIG)
|
2021-01-25 17:47:30 +08:00
|
|
|
target_link_libraries(harfbuzz INTERFACE freetype)
|
|
|
|
|
|
|
|
if ("graphite2" IN_LIST HARFBUZZ_FEATURES)
|
|
|
|
find_library(GRAPHITE2_LIBRARY_DEBUG NAMES graphite2 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
|
|
|
if(GRAPHITE2_LIBRARY_DEBUG)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<CONFIG:DEBUG>:${GRAPHITE2_LIBRARY_DEBUG}>)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(GRAPHITE2_LIBRARY_RELEASE NAMES graphite2 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
|
|
|
if(GRAPHITE2_LIBRARY_RELEASE)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${GRAPHITE2_LIBRARY_RELEASE}>)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if ("glib" IN_LIST HARFBUZZ_FEATURES)
|
|
|
|
find_library(GLIB_LIBRARY_DEBUG NAMES glib glib-2.0 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
|
|
|
if(GLIB_LIBRARY_DEBUG)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<CONFIG:DEBUG>:${GLIB_LIBRARY_DEBUG}>)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(GLIB_LIBRARY_RELEASE NAMES glib glib-2.0 PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" PATH_SUFFIXES lib NO_DEFAULT_PATH)
|
|
|
|
if(GLIB_LIBRARY_RELEASE)
|
|
|
|
target_link_libraries(harfbuzz INTERFACE $<$<NOT:$<CONFIG:DEBUG>>:${GLIB_LIBRARY_RELEASE}>)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if ("icu" IN_LIST HARFBUZZ_FEATURES)
|
2022-02-24 03:57:13 +08:00
|
|
|
find_dependency(ICU 61 COMPONENTS uc)
|
2021-01-25 17:47:30 +08:00
|
|
|
target_link_libraries(harfbuzz INTERFACE ICU::uc)
|
|
|
|
endif()
|
|
|
|
|
2022-06-09 06:44:40 +08:00
|
|
|
target_include_directories(harfbuzz INTERFACE "${HARFBUZZ_INCLUDE_DIR}")
|