File: FindXCB.cmake

package info (click to toggle)
maliit-framework 2.3.0-3.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,488 kB
  • sloc: cpp: 13,098; ansic: 2,506; xml: 299; sh: 34; makefile: 23; sed: 4
file content (53 lines) | stat: -rw-r--r-- 1,914 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#.rst:
# FindXCB
# -------
#
# Find XCB libraries
#
# Tries to find xcb libraries on unix systems.
#
# - Be sure to set the COMPONENTS to the components you want to link to
# - The XCB_LIBRARIES variable is set ONLY to your COMPONENTS list
# - To use only a specific component check the XCB_LIBRARIES_${COMPONENT} variable
#
# The following values are defined
#
# ::
#
#   XCB_FOUND         - True if xcb is available
#   XCB_INCLUDE_DIRS  - Include directories for xcb
#   XCB_LIBRARIES     - List of libraries for xcb
#   XCB_DEFINITIONS   - List of definitions for xcb
#
#=============================================================================
# Copyright (c) 2015 Jari Vetoniemi
#
# Distributed under the OSI-approved BSD License (the "License");
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================

include(FeatureSummary)
set_package_properties(XCB PROPERTIES
   URL "http://xcb.freedesktop.org/"
   DESCRIPTION "X protocol C-language Binding")

find_package(PkgConfig)
pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS})

find_library(XCB_LIBRARIES xcb HINTS ${PC_XCB_LIBRARY_DIRS})
find_path(XCB_INCLUDE_DIRS xcb/xcb.h PATH_SUFFIXES xcb HINTS ${PC_XCB_INCLUDE_DIRS})

foreach(COMPONENT ${XCB_FIND_COMPONENTS})
	find_library(XCB_LIBRARIES_${COMPONENT} xcb-${COMPONENT} HINTS ${PC_XCB_LIBRARY_DIRS})
	list(APPEND XCB_LIBRARIES ${XCB_LIBRARIES_${COMPONENT}})
	mark_as_advanced(XCB_LIBRARIES_${COMPONENT})
endforeach(COMPONENT ${XCB_FIND_COMPONENTS})

set(XCB_DEFINITIONS ${PC_XCB_CFLAGS_OTHER})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XCB DEFAULT_MSG XCB_LIBRARIES XCB_INCLUDE_DIRS)
mark_as_advanced(XCB_INCLUDE_DIRS XCB_LIBRARIES XCB_DEFINITIONS)