if(NOT PANGO_FIND_VERSION)
	set(PANGO_FIND_VERSION 1.0)
endif()
if(NOT GLIB_FIND_VERSION)
	set(GLIB_FIND_VERSION 2.0)
endif()

find_path(PANGO_INCLUDE_DIR NAMES pango/pangocairo.h PATH_SUFFIXES pango-${PANGO_FIND_VERSION})
find_path(GLIB_INCLUDE_DIR NAMES glib.h PATH_SUFFIXES glib-${GLIB_FIND_VERSION})
find_path(GLIBCONFIG_INCLUDE_DIR NAMES glibconfig.h HINTS /usr/lib /usr/lib/x86_64-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu PATH_SUFFIXES glib-${GLIB_FIND_VERSION}/include)
find_path(CAIRO_INCLUDE_DIR NAMES cairo.h PATH_SUFFIXES cairo)
find_library(PANGOCAIRO_LIBRARY NAMES pangocairo-${PANGO_FIND_VERSION} PATH_SUFFIXES lib64)
find_library(PANGO_LIBRARY NAMES pango-${PANGO_FIND_VERSION} PATH_SUFFIXES lib64)
find_library(GLIB_LIBRARY NAMES glib-${GLIB_FIND_VERSION} PATH_SUFFIXES lib64)
find_library(CAIRO_LIBRARY NAMES cairo PATH_SUFFIXES lib64)

set(PANGOCAIRO_INCLUDE_DIRS ${PANGO_INCLUDE_DIR} ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR} ${CAIRO_INCLUDE_DIR})
set(PANGOCAIRO_LIBRARIES ${PANGOCAIRO_LIBRARY} ${PANGO_LIBRARY} ${GLIB_LIBRARY} ${CAIRO_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PANGOCAIRO
				REQUIRED_VARS PANGO_INCLUDE_DIR GLIB_INCLUDE_DIR GLIBCONFIG_INCLUDE_DIR CAIRO_INCLUDE_DIR PANGOCAIRO_LIBRARY PANGO_LIBRARY GLIB_LIBRARY CAIRO_LIBRARY)

mark_as_advanced(PANGO_INCLUDE_DIR GLIB_INCLUDE_DIR GLIBCONFIG_INCLUDE_DIR CAIRO_INCLUDE_DIR PANGOCAIRO_LIBRARY PANGO_LIBRARY GLIB_LIBRARY CAIRO_LIBRARY)
