IF(NOT WIN32)
    IF(LIBXCB_INCLUDE_DIR AND LIBXCB_LIBRARIES)

        SET(XCB_FIND_QUIETLY TRUE)

    ENDIF(LIBXCB_INCLUDE_DIR AND LIBXCB_LIBRARIES)

    FIND_PACKAGE(PkgConfig)
    PKG_CHECK_MODULES(PKG_XCB xcb)

    SET(LIBXCB_DEFINITIONS ${PKG_XCB_CFLAGS})

    FIND_PATH(LIBXCB_INCLUDE_DIRS xcb/xcb.h ${PKG_XCB_INCLUDE_DIRS})
    FIND_LIBRARY(LIBXCB_LIBRARIES NAMES xcb libxcb PATHS ${PKG_XCB_LIBRARY_DIRS})

    INCLUDE(FindPackageHandleStandardArgs)
    FIND_PACKAGE_HANDLE_STANDARD_ARGS(XCB DEFAULT_MSG LIBXCB_LIBRARIES LIBXCB_INCLUDE_DIRS)

    MARK_AS_ADVANCED(LIBXCB_INCLUDE_DIRS LIBXCB_LIBRARIES XCBPROC_EXECUTABLE)
ENDIF(NOT WIN32)