Use pkg-config to check for XInput2

This commit is contained in:
Jasper St. Pierre 2013-07-21 00:43:48 -04:00
parent fe2fe8b6cc
commit 3239e4946f
2 changed files with 4 additions and 33 deletions

View File

@ -430,12 +430,13 @@ if(NOT ANDROID)
else()
add_definitions(-DHAVE_XRANDR=0)
endif(XRANDR_FOUND)
include(FindX11XInput2)
if(X11_Xinput2_FOUND)
pkg_check_modules(XINPUT2 xi>=1.5.0)
if(XINPUT2_FOUND)
add_definitions(-DHAVE_X11_XINPUT2=1)
else()
add_definitions(-DHAVE_X11_XINPUT2=0)
endif(X11_Xinput2_FOUND)
endif(XINPUT2_FOUND)
endif()
if(ENCODE_FRAMEDUMPS)
check_libav()

View File

@ -1,30 +0,0 @@
# For finding the X11 XInput extension, version 2. Because the standard CMake
# FindX11.cmake may only know to look for version 1. Newer versions of CMake
# than 2.8.7 might not have this problem, I wouldn't know. Better to be safe.
if(USE_X11)
IF(NOT X11_FOUND)
INCLUDE(FindX11)
ENDIF(NOT X11_FOUND)
IF(X11_FOUND)
FIND_PATH(X11_Xinput2_INCLUDE_PATH X11/extensions/XInput2.h ${X11_INC_SEARCH_PATH})
FIND_LIBRARY(X11_Xinput2_LIB Xi ${X11_LIB_SEARCH_PATH})
IF (X11_Xinput2_INCLUDE_PATH AND X11_Xinput2_LIB)
SET(X11_Xinput2_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput2_INCLUDE_PATH})
message("X11 Xinput2 found")
ENDIF (X11_Xinput2_INCLUDE_PATH AND X11_Xinput2_LIB)
MARK_AS_ADVANCED(
X11_Xinput2_INCLUDE_PATH
X11_Xinput2_LIB
)
ENDIF(X11_FOUND)
endif()