wxWidgets/build/cmake/modules/FindXKBCommon.cmake
Maarten Bent 8437eefbe5 CMake: Check and enable use of libxkbcommon
CMake's has built-in support for checking xkbcommon using FindX11 since
3.18.

But because older CMake versions are supported, add our own module that
checks if the header and library is available.

See #23410, #23613.

(cherry picked from commit a801057f1a7fba8e353be9481c1e621b8bf1dbe2)
2023-06-06 21:28:18 +02:00

29 lines
717 B
CMake

# FindXKBCommon
find_package(PkgConfig)
pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
find_path(XKBCOMMON_INCLUDE_DIRS
NAMES xkbcommon.h
HINTS ${PC_XKBCOMMON_INCLUDEDIR}
${PC_XKBCOMMON_INCLUDE_DIRS}
PATH_SUFFIXES xkbcommon
)
find_library(XKBCOMMON_LIBRARIES
NAMES xkbcommon
HINTS ${PC_XKBCOMMON_LIBDIR}
${PC_XKBCOMMON_LIBRARY_DIRS}
)
set(XKBCOMMON_VERSION ${PC_XKBCOMMON_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(XKBCommon REQUIRED_VARS XKBCOMMON_INCLUDE_DIRS XKBCOMMON_LIBRARIES
VERSION_VAR XKBCOMMON_VERSION)
mark_as_advanced(
XKBCOMMON_INCLUDE_DIRS
XKBCOMMON_LIBRARIES
)