INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_CAIRO QUIET cairo)

IF (NOT CAIRO_INCLUDE_DIR)
    FIND_PATH(CAIRO_INCLUDE_DIR cairo.h
        HINTS $ENV{CAIRO_DIR} ${PC_CAIRO_INCLUDEDIR} ${PC_CAIRO_INCLUDE_DIRS}
        PATH_SUFFIXES cairo
    )
ENDIF()
IF (NOT CAIRO_LIBRARIES)
    FIND_LIBRARY(CAIRO_LIBRARIES cairo HINTS $ENV{CAIRO_DIR})
ENDIF()

MARK_AS_ADVANCED(CAIRO_INCLUDE_DIR)
MARK_AS_ADVANCED(CAIRO_LIBRARIES)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(
    Cairo
    DEFAULT_MSG
    CAIRO_LIBRARIES
    CAIRO_INCLUDE_DIR
)

