• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# - Try to find XKBCommon
2# Once done, this will define
3#
4#   XKBCOMMON_FOUND - System has XKBCommon
5#   XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
6#   XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
7#   XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
8
9find_package(PkgConfig)
10pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
11set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
12
13find_path(XKBCOMMON_INCLUDE_DIR
14    NAMES xkbcommon/xkbcommon.h
15    HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
16)
17
18find_library(XKBCOMMON_LIBRARY
19    NAMES xkbcommon
20    HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
21)
22
23set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
24set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
25set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
26
27include(FindPackageHandleStandardArgs)
28find_package_handle_standard_args(XKBCommon DEFAULT_MSG
29    XKBCOMMON_LIBRARY
30    XKBCOMMON_INCLUDE_DIR
31)
32
33mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
34
35