aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules/FindLibInput.cmake
blob: 069df5f780d7e454fbd69b0bc1c3df22a5965aa4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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)