Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpadx/cmake/modules/FindX11_XCB.cmake
- This file was added.
1 | # - Try to find libX11-xcb | ||||
---|---|---|---|---|---|
2 | # Once done this will define | ||||
3 | # | ||||
4 | # X11_XCB_FOUND - system has libX11-xcb | ||||
5 | # X11_XCB_LIBRARIES - Link these to use libX11-xcb | ||||
6 | # X11_XCB_INCLUDE_DIR - the libX11-xcb include dir | ||||
7 | # X11_XCB_DEFINITIONS - compiler switches required for using libX11-xcb | ||||
8 | | ||||
9 | # Copyright (c) 2012 Fredrik Höglund <fredrik@kde.org> | ||||
10 | # Copyright (c) 2008 Helio Chissini de Castro, <helio@kde.org> | ||||
11 | # Copyright (c) 2007 Matthias Kretz, <kretz@kde.org> | ||||
12 | # | ||||
13 | # Redistribution and use in source and binary forms, with or without | ||||
14 | # modification, are permitted provided that the following conditions | ||||
15 | # are met: | ||||
16 | # 1. Redistributions of source code must retain the above copyright | ||||
17 | # notice, this list of conditions and the following disclaimer. | ||||
18 | # 2. Redistributions in binary form must reproduce the above copyright | ||||
19 | # notice, this list of conditions and the following disclaimer in the | ||||
20 | # documentation and/or other materials provided with the distribution. | ||||
21 | # 3. Neither the name of the University nor the names of its contributors | ||||
22 | # may be used to endorse or promote products derived from this software | ||||
23 | # without specific prior written permission. | ||||
24 | # | ||||
25 | # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||||
26 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||
27 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||||
28 | # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||||
29 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
30 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||||
31 | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
32 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
33 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
34 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
35 | # SUCH DAMAGE. | ||||
36 | | ||||
37 | IF (NOT WIN32) | ||||
38 | # use pkg-config to get the directories and then use these values | ||||
39 | # in the FIND_PATH() and FIND_LIBRARY() calls | ||||
40 | FIND_PACKAGE(PkgConfig) | ||||
41 | PKG_CHECK_MODULES(PKG_X11_XCB QUIET x11-xcb) | ||||
42 | | ||||
43 | SET(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS}) | ||||
44 | | ||||
45 | FIND_PATH(X11_XCB_INCLUDE_DIR NAMES X11/Xlib-xcb.h HINTS ${PKG_X11_XCB_INCLUDE_DIRS}) | ||||
46 | FIND_LIBRARY(X11_XCB_LIBRARIES NAMES X11-xcb HINTS ${PKG_X11_XCB_LIBRARY_DIRS}) | ||||
47 | | ||||
48 | include(FindPackageHandleStandardArgs) | ||||
49 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(X11_XCB DEFAULT_MSG X11_XCB_LIBRARIES X11_XCB_INCLUDE_DIR) | ||||
50 | | ||||
51 | MARK_AS_ADVANCED(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARIES) | ||||
52 | ENDIF (NOT WIN32) | ||||
53 | |