Made XInput2 optional at compile-time.

This is required for RHEL 5, CentOS 5 and Cygwin-X.

Fixes #314.
This commit is contained in:
Camilla Berglund
2015-01-27 23:48:29 +01:00
parent 93855ae6ab
commit f4c127f75a
7 changed files with 40 additions and 22 deletions
+10 -10
View File
@@ -273,19 +273,19 @@ if (_GLFW_X11)
list(APPEND glfw_PKG_DEPS "xinerama")
# Check for XInput (high-resolution cursor motion)
if (NOT X11_Xinput_FOUND)
message(FATAL_ERROR "The XInput library and headers were not found")
endif()
if (X11_Xinput_FOUND)
list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}")
list(APPEND glfw_PKG_DEPS "xi")
list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}")
if (X11_Xinput_LIB)
list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}")
else()
# Backwards compatibility (bug in CMake 2.8.7)
list(APPEND glfw_LIBRARIES Xi)
endif()
if (X11_Xinput_LIB)
list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}")
else()
# Backwards compatibility (bug in CMake 2.8.7)
list(APPEND glfw_LIBRARIES Xi)
set(_GLFW_HAS_XINPUT TRUE)
endif()
list(APPEND glfw_PKG_DEPS "xi")
# Check for Xf86VidMode (fallback gamma control)
if (NOT X11_xf86vmode_FOUND)