3 # Finds the libxkbcommon library
5 # This will define the following target:
7 # ${APP_NAME_LC}::Xkbcommon - The libxkbcommon library
9 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
10 find_package(PkgConfig)
12 pkg_check_modules(PC_XKBCOMMON xkbcommon QUIET)
15 find_path(XKBCOMMON_INCLUDE_DIR NAMES xkbcommon/xkbcommon.h
16 HINTS ${PC_XKBCOMMON_INCLUDEDIR})
17 find_library(XKBCOMMON_LIBRARY NAMES xkbcommon
18 HINTS ${PC_XKBCOMMON_LIBDIR})
20 set(XKBCOMMON_VERSION ${PC_XKBCOMMON_VERSION})
22 include(FindPackageHandleStandardArgs)
23 find_package_handle_standard_args(Xkbcommon
24 REQUIRED_VARS XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR
25 VERSION_VAR XKBCOMMON_VERSION)
28 add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
29 set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
30 IMPORTED_LOCATION "${XKBCOMMON_LIBRARY}"
31 INTERFACE_INCLUDE_DIRECTORIES "${XKBCOMMON_INCLUDE_DIR}")