Fixing FindGLFW cmake module

Previously, FindGLFW would search for both GL/glfw.h and GLFW/glfw3.h, which
does not work when a system has both GLFW 2.0 and 3.0 installed.

The fix still probes for both files, but does so in two passes, preferring
glfw3.h.
This commit is contained in:
Jeremy Cowles 2015-04-18 21:28:07 -07:00
parent 247683e340
commit ef97b4523d

View File

@ -32,7 +32,6 @@
find_path( GLFW_INCLUDE_DIR
NAMES
GL/glfw.h
GLFW/glfw3.h
HINTS
"${GLFW_LOCATION}/include"
@ -49,6 +48,31 @@ find_path( GLFW_INCLUDE_DIR
/usr/local/include
/usr/include/GL
/usr/include
DOC
"The directory where GLFW/glfw3.h resides"
)
#
# XXX: Do we still need to search for GL/glfw.h?
#
find_path( GLFW_INCLUDE_DIR
NAMES
GL/glfw.h
HINTS
"${GLFW_LOCATION}/include"
"$ENV{GLFW_LOCATION}/include"
PATHS
"$ENV{PROGRAMFILES}/GLFW/include"
"${OPENGL_INCLUDE_DIR}"
/usr/openwin/share/include
/usr/openwin/include
/usr/X11R6/include
/usr/include/X11
/opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglfw
/usr/local/include
/usr/include/GL
/usr/include
DOC
"The directory where GL/glfw.h resides"
)