Warning, /plasma/kwin/cmake/modules/FindXKB.cmake is written in an unsupported language. File is not indexed.

0001 #.rst:
0002 # FindXKB
0003 # -------
0004 #
0005 # Try to find xkbcommon on a Unix system
0006 # If found, this will define the following variables:
0007 #
0008 #   ``XKB_FOUND``
0009 #     True if XKB is available
0010 #   ``XKB_LIBRARIES``
0011 #     Link these to use XKB
0012 #   ``XKB_INCLUDE_DIRS``
0013 #     Include directory for XKB
0014 #   ``XKB_DEFINITIONS``
0015 #     Compiler flags for using XKB
0016 #
0017 # Additionally, the following imported targets will be defined:
0018 #
0019 #   ``XKB::XKB``
0020 #     The XKB library
0021 
0022 #=============================================================================
0023 # SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0024 #
0025 # SPDX-License-Identifier: BSD-3-Clause
0026 #=============================================================================
0027 
0028 if(CMAKE_VERSION VERSION_LESS 2.8.12)
0029     message(FATAL_ERROR "CMake 2.8.12 is required by FindXKB.cmake")
0030 endif()
0031 if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
0032     message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindXKB.cmake")
0033 endif()
0034 
0035 if(NOT WIN32)
0036     # Use pkg-config to get the directories and then use these values
0037     # in the FIND_PATH() and FIND_LIBRARY() calls
0038     find_package(PkgConfig)
0039     pkg_check_modules(PKG_XKB QUIET xkbcommon)
0040 
0041     set(XKB_DEFINITIONS ${PKG_XKB_CFLAGS_OTHER})
0042 
0043     find_path(XKB_INCLUDE_DIR
0044         NAMES
0045             xkbcommon/xkbcommon.h
0046         HINTS
0047             ${PKG_XKB_INCLUDE_DIRS}
0048     )
0049     find_library(XKB_LIBRARY
0050         NAMES
0051             xkbcommon
0052         HINTS
0053             ${PKG_XKB_LIBRARY_DIRS}
0054     )
0055 
0056     set(XKB_LIBRARIES ${XKB_LIBRARY})
0057     set(XKB_INCLUDE_DIRS ${XKB_INCLUDE_DIR})
0058     set(XKB_VERSION ${PKG_XKB_VERSION})
0059 
0060     include(FindPackageHandleStandardArgs)
0061     find_package_handle_standard_args(XKB
0062         FOUND_VAR
0063             XKB_FOUND
0064         REQUIRED_VARS
0065             XKB_LIBRARY
0066             XKB_INCLUDE_DIR
0067         VERSION_VAR
0068             XKB_VERSION
0069     )
0070 
0071     if(XKB_FOUND AND NOT TARGET XKB::XKB)
0072         add_library(XKB::XKB UNKNOWN IMPORTED)
0073         set_target_properties(XKB::XKB PROPERTIES
0074             IMPORTED_LOCATION "${XKB_LIBRARY}"
0075             INTERFACE_COMPILE_OPTIONS "${XKB_DEFINITIONS}"
0076             INTERFACE_INCLUDE_DIRECTORIES "${XKB_INCLUDE_DIR}"
0077         )
0078     endif()
0079 
0080 else()
0081     message(STATUS "FindXKB.cmake cannot find XKB on Windows systems.")
0082     set(XKB_FOUND FALSE)
0083 endif()
0084 
0085 include(FeatureSummary)
0086 set_package_properties(XKB PROPERTIES
0087     URL "https://xkbcommon.org"
0088     DESCRIPTION "XKB API common to servers and clients"
0089 )