2015-11-12 13:17:52 +00:00
|
|
|
# - Try to find the pango library
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# PANGO_FOUND - system has pango
|
|
|
|
# PANGO_INCLUDE_DIRS - the pango include directory
|
|
|
|
# PANGO_LIBRARIES - Link these to use pango
|
|
|
|
#
|
|
|
|
# Define PANGO_MIN_VERSION for which version desired.
|
|
|
|
#
|
|
|
|
|
2016-12-08 12:34:08 +00:00
|
|
|
find_package(PkgConfig)
|
2015-11-12 13:17:52 +00:00
|
|
|
|
2016-12-08 12:34:08 +00:00
|
|
|
if(Pango_FIND_REQUIRED)
|
|
|
|
set(_pkgconfig_REQUIRED "REQUIRED")
|
|
|
|
else(Pango_FIND_REQUIRED)
|
|
|
|
set(_pkgconfig_REQUIRED "")
|
|
|
|
endif(Pango_FIND_REQUIRED)
|
2015-11-12 13:17:52 +00:00
|
|
|
|
2016-12-08 12:34:08 +00:00
|
|
|
if(PANGO_MIN_VERSION)
|
|
|
|
pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} "pango>=${PANGO_MIN_VERSION}" "pangocairo>=${PANGO_MIN_VERSION}")
|
|
|
|
else(PANGO_MIN_VERSION)
|
|
|
|
pkg_check_modules(PANGO ${_pkgconfig_REQUIRED} pango pangocairo)
|
|
|
|
endif(PANGO_MIN_VERSION)
|
2015-11-12 13:17:52 +00:00
|
|
|
|
2016-12-08 12:34:08 +00:00
|
|
|
if(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
find_path(PANGO_INCLUDE_DIRS pango.h)
|
|
|
|
find_library(PANGO_LIBRARIES pango pangocairo)
|
|
|
|
else(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
|
|
|
|
# Make paths absolute https://stackoverflow.com/a/35476270
|
|
|
|
# Important on FreeBSD because /usr/local/lib is not on /usr/bin/ld's default path
|
|
|
|
set(PANGO_LIBS_ABSOLUTE)
|
|
|
|
foreach(lib ${PANGO_LIBRARIES})
|
|
|
|
set(var_name PANGO_${lib}_ABS)
|
|
|
|
find_library(${var_name} ${lib} ${PANGO_LIBRARY_DIRS})
|
|
|
|
list(APPEND PANGO_LIBS_ABSOLUTE ${${var_name}})
|
|
|
|
endforeach()
|
|
|
|
set(PANGO_LIBRARIES ${PANGO_LIBS_ABSOLUTE})
|
|
|
|
endif(NOT PANGO_FOUND AND NOT PKG_CONFIG_FOUND)
|
2015-11-12 13:17:52 +00:00
|
|
|
|
2016-12-08 12:34:08 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(PANGO DEFAULT_MSG PANGO_LIBRARIES PANGO_INCLUDE_DIRS)
|
|
|
|
mark_as_advanced(PANGO_LIBRARIES PANGO_INCLUDE_DIRS)
|