From 2577b55681a97f3eec3fb0e3b5a4fb7f2cb18b8a Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 30 Aug 2018 00:42:04 +0200 Subject: sync with upstream --- cmake/modules/FindLibInput.cmake | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cmake/modules/FindLibInput.cmake (limited to 'cmake/modules/FindLibInput.cmake') diff --git a/cmake/modules/FindLibInput.cmake b/cmake/modules/FindLibInput.cmake new file mode 100644 index 0000000..069df5f --- /dev/null +++ b/cmake/modules/FindLibInput.cmake @@ -0,0 +1,36 @@ +#.rst: +# FindLibinput +# -------- +# Finds the libinput library +# +# This will define the following variables:: +# +# LIBINPUT_FOUND - system has libinput +# LIBINPUT_INCLUDE_DIRS - the libinput include directory +# LIBINPUT_LIBRARIES - the libinput libraries +# LIBINPUT_DEFINITIONS - the libinput compile definitions +# + +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_LIBINPUT libinput QUIET) +endif() + +find_path(LIBINPUT_INCLUDE_DIR NAMES libinput.h + PATHS ${PC_LIBINPUT_INCLUDEDIR}) + +find_library(LIBINPUT_LIBRARY NAMES input + PATHS ${PC_LIBINPUT_LIBDIR}) + +set(LIBINPUT_VERSION ${PC_LIBINPUT_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibInput + REQUIRED_VARS LIBINPUT_LIBRARY LIBINPUT_INCLUDE_DIR + VERSION_VAR LIBINPUT_VERSION) + +if(LIBINPUT_FOUND) + set(LIBINPUT_INCLUDE_DIRS ${LIBINPUT_INCLUDE_DIR}) + set(LIBINPUT_LIBRARIES ${LIBINPUT_LIBRARY}) +endif() + +mark_as_advanced(LIBINPUT_INCLUDE_DIR LIBINPUT_LIBRARY) -- cgit v1.2.3