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

0001 #.rst:
0002 # Findgbm
0003 # -------
0004 #
0005 # Try to find gbm on a Unix system.
0006 #
0007 # This will define the following variables:
0008 #
0009 # ``gbm_FOUND``
0010 #     True if (the requested version of) gbm is available
0011 # ``gbm_VERSION``
0012 #     The version of gbm
0013 # ``gbm_LIBRARIES``
0014 #     This can be passed to target_link_libraries() instead of the ``gbm::gbm``
0015 #     target
0016 # ``gbm_INCLUDE_DIRS``
0017 #     This should be passed to target_include_directories() if the target is not
0018 #     used for linking
0019 # ``gbm_DEFINITIONS``
0020 #     This should be passed to target_compile_options() if the target is not
0021 #     used for linking
0022 #
0023 # If ``gbm_FOUND`` is TRUE, it will also define the following imported target:
0024 #
0025 # ``gbm::gbm``
0026 #     The gbm library
0027 #
0028 # In general we recommend using the imported target, as it is easier to use.
0029 # Bear in mind, however, that if the target is in the link interface of an
0030 # exported library, it must be made available by the package config file.
0031 
0032 #=============================================================================
0033 # SPDX-FileCopyrightText: 2014 Alex Merry <alex.merry@kde.org>
0034 # SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0035 #
0036 # SPDX-License-Identifier: BSD-3-Clause
0037 #=============================================================================
0038 
0039 if(CMAKE_VERSION VERSION_LESS 2.8.12)
0040     message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake")
0041 endif()
0042 if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
0043     message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake")
0044 endif()
0045 
0046 if(NOT WIN32)
0047     # Use pkg-config to get the directories and then use these values
0048     # in the FIND_PATH() and FIND_LIBRARY() calls
0049     find_package(PkgConfig)
0050     pkg_check_modules(PKG_gbm QUIET gbm)
0051 
0052     set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER})
0053     set(gbm_VERSION ${PKG_gbm_VERSION})
0054 
0055     find_path(gbm_INCLUDE_DIR
0056         NAMES
0057             gbm.h
0058         HINTS
0059             ${PKG_gbm_INCLUDE_DIRS}
0060     )
0061     find_library(gbm_LIBRARY
0062         NAMES
0063             gbm
0064         HINTS
0065             ${PKG_gbm_LIBRARY_DIRS}
0066     )
0067 
0068     include(FindPackageHandleStandardArgs)
0069     find_package_handle_standard_args(gbm
0070         FOUND_VAR
0071             gbm_FOUND
0072         REQUIRED_VARS
0073             gbm_LIBRARY
0074             gbm_INCLUDE_DIR
0075         VERSION_VAR
0076             gbm_VERSION
0077     )
0078 
0079     if(gbm_FOUND AND NOT TARGET gbm::gbm)
0080         add_library(gbm::gbm UNKNOWN IMPORTED)
0081         set_target_properties(gbm::gbm PROPERTIES
0082             IMPORTED_LOCATION "${gbm_LIBRARY}"
0083             INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}"
0084             INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}"
0085         )
0086     endif()
0087 
0088     mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR)
0089 
0090     # compatibility variables
0091     set(gbm_LIBRARIES ${gbm_LIBRARY})
0092     set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR})
0093     set(gbm_VERSION_STRING ${gbm_VERSION})
0094 
0095 else()
0096     message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.")
0097     set(gbm_FOUND FALSE)
0098 endif()
0099 
0100 include(FeatureSummary)
0101 set_package_properties(gbm PROPERTIES
0102     URL "https://www.mesa3d.org"
0103     DESCRIPTION "Mesa gbm library"
0104 )