2 # Once done this will define
4 # LIBXCB_FOUND - system has libxcb
5 # LIBXCB_LIBRARIES - Link these to use libxcb
6 # LIBXCB_INCLUDE_DIR - the libxcb include dir
7 # LIBXCB_DEFINITIONS - compiler switches required for using libxcb
9 # Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org>
10 # Copyright (c) 2007, Matthias Kretz, <kretz@kde.org>
12 # Redistribution and use is allowed according to the terms of the BSD license.
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 IF (LIBXCB_INCLUDE_DIR AND LIBXCB_LIBRARIES)
19 SET(XCB_FIND_QUIETLY TRUE)
20 ENDIF (LIBXCB_INCLUDE_DIR AND LIBXCB_LIBRARIES)
22 # use pkg-config to get the directories and then use these values
23 # in the FIND_PATH() and FIND_LIBRARY() calls
24 FIND_PACKAGE(PkgConfig)
25 PKG_CHECK_MODULES(PKG_XCB xcb)
27 SET(LIBXCB_DEFINITIONS ${PKG_XCB_CFLAGS})
29 FIND_PATH(LIBXCB_INCLUDE_DIR xcb/xcb.h
30 ${PKG_XCB_INCLUDE_DIRS}
33 FIND_LIBRARY(LIBXCB_LIBRARIES NAMES xcb libxcb
35 ${PKG_XCB_LIBRARY_DIRS}
38 include(FindPackageHandleStandardArgs)
39 FIND_PACKAGE_HANDLE_STANDARD_ARGS(XCB DEFAULT_MSG LIBXCB_INCLUDE_DIR LIBXCB_LIBRARIES )
42 MARK_AS_ADVANCED(LIBXCB_INCLUDE_DIR LIBXCB_LIBRARIES XCBPROC_EXECUTABLE)