summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindLibInput.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindLibInput.cmake
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindLibInput.cmake')
-rw-r--r--cmake/modules/FindLibInput.cmake36
1 files changed, 36 insertions, 0 deletions
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)