Warning, /frameworks/extra-cmake-modules/find-modules/FindX11_XCB.cmake is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org> 0002 # SPDX-FileCopyrightText: 2011 Fredrik Höglund <fredrik@kde.org> 0003 # SPDX-FileCopyrightText: 2008 Helio Chissini de Castro <helio@kde.org> 0004 # SPDX-FileCopyrightText: 2007 Matthias Kretz <kretz@kde.org> 0005 # 0006 # SPDX-License-Identifier: BSD-3-Clause 0007 0008 #[=======================================================================[.rst: 0009 FindX11_XCB 0010 ----------- 0011 0012 Try to find the X11 XCB compatibility library. 0013 0014 This will define the following variables: 0015 0016 ``X11_XCB_FOUND`` 0017 True if (the requested version of) libX11-xcb is available 0018 ``X11_XCB_VERSION`` 0019 The version of libX11-xcb (this is not guaranteed to be set even when 0020 X11_XCB_FOUND is true) 0021 ``X11_XCB_LIBRARIES`` 0022 This can be passed to target_link_libraries() instead of the ``EGL::EGL`` 0023 target 0024 ``X11_XCB_INCLUDE_DIR`` 0025 This should be passed to target_include_directories() if the target is not 0026 used for linking 0027 ``X11_XCB_DEFINITIONS`` 0028 This should be passed to target_compile_options() if the target is not 0029 used for linking 0030 0031 If ``X11_XCB_FOUND`` is TRUE, it will also define the following imported 0032 target: 0033 0034 ``X11::XCB`` 0035 The X11 XCB compatibility library 0036 0037 In general we recommend using the imported target, as it is easier to use. 0038 Bear in mind, however, that if the target is in the link interface of an 0039 exported library, it must be made available by the package config file. 0040 0041 Since pre-1.0.0. 0042 #]=======================================================================] 0043 0044 include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) 0045 0046 ecm_find_package_version_check(X11_XCB) 0047 0048 # use pkg-config to get the directories and then use these values 0049 # in the FIND_PATH() and FIND_LIBRARY() calls 0050 find_package(PkgConfig QUIET) 0051 pkg_check_modules(PKG_X11_XCB QUIET x11-xcb) 0052 0053 set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER}) 0054 set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION}) 0055 0056 find_path(X11_XCB_INCLUDE_DIR 0057 NAMES X11/Xlib-xcb.h 0058 HINTS ${PKG_X11_XCB_INCLUDE_DIRS} 0059 ) 0060 find_library(X11_XCB_LIBRARY 0061 NAMES X11-xcb 0062 HINTS ${PKG_X11_XCB_LIBRARY_DIRS} 0063 ) 0064 0065 include(FindPackageHandleStandardArgs) 0066 find_package_handle_standard_args(X11_XCB 0067 FOUND_VAR 0068 X11_XCB_FOUND 0069 REQUIRED_VARS 0070 X11_XCB_LIBRARY 0071 X11_XCB_INCLUDE_DIR 0072 VERSION_VAR 0073 X11_XCB_VERSION 0074 ) 0075 0076 if(X11_XCB_FOUND AND NOT TARGET X11::XCB) 0077 add_library(X11::XCB UNKNOWN IMPORTED) 0078 set_target_properties(X11::XCB PROPERTIES 0079 IMPORTED_LOCATION "${X11_XCB_LIBRARY}" 0080 INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}" 0081 INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}" 0082 ) 0083 endif() 0084 0085 mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY) 0086 0087 # compatibility variables 0088 set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY}) 0089 set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR}) 0090 set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION}) 0091 0092 include(FeatureSummary) 0093 set_package_properties(X11_XCB PROPERTIES 0094 URL "https://xorg.freedesktop.org/" 0095 DESCRIPTION "A compatibility library for code that translates Xlib API calls into XCB calls" 0096 )