2 # Find the Xi libraries
4 # This module defines the following variables:
5 # XI_FOUND - true if XI_INCLUDE_DIR & XI_LIBRARY are found
6 # XI_LIBRARIES - Set when XI_LIBRARY is found
7 # XI_INCLUDE_DIRS - Set when XI_INCLUDE_DIR is found
9 # XI_INCLUDE_DIR - where to find XInput2.h, etc.
10 # XI_LIBRARY - the Xi library
13 #=============================================================================
14 # Copyright 2011 O.S. Systems Software Ltda.
15 # Copyright 2011 Otavio Salvador <otavio@ossystems.com.br>
16 # Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
17 # Copyright 2013 Corey Clayton <can.of.tuna@gmail.com>
19 # Licensed under the Apache License, Version 2.0 (the "License");
20 # you may not use this file except in compliance with the License.
21 # You may obtain a copy of the License at
23 # http://www.apache.org/licenses/LICENSE-2.0
25 # Unless required by applicable law or agreed to in writing, software
26 # distributed under the License is distributed on an "AS IS" BASIS,
27 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 # See the License for the specific language governing permissions and
29 # limitations under the License.
30 #=============================================================================
32 include(CheckSymbolExists)
34 find_path(XI_INCLUDE_DIR NAMES X11/extensions/XInput2.h
35 PATHS /opt/X11/include
36 DOC "The Xi include directory")
38 find_library(XI_LIBRARY NAMES Xi
42 include(FindPackageHandleStandardArgs)
43 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xi DEFAULT_MSG XI_LIBRARY XI_INCLUDE_DIR)
46 check_symbol_exists(XITouchClass "${XI_INCLUDE_DIR}/X11/extensions/XInput2.h" HAVE_XI_TOUCH_CLASS)
48 if (NOT HAVE_XI_TOUCH_CLASS)
54 set(XI_LIBRARIES ${XI_LIBRARY})
55 set(XI_INCLUDE_DIRS ${XI_INCLUDE_DIR})
58 mark_as_advanced(XI_INCLUDE_DIR XI_LIBRARY)