Force our glxext.h headers to be included instead of the system ones.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 18 Jan 2012 09:51:54 +0000 (09:51 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 18 Jan 2012 09:51:54 +0000 (09:51 +0000)
Gl/glx.h often includes GL/glxext.h, which may be outdated.

So manipulate the include path so that our headers are found first.

CMakeLists.txt
glimports.hpp
thirdparty/glext/GL/Makefile [moved from thirdparty/glext/Makefile with 100% similarity]
thirdparty/glext/GL/glext.h [moved from thirdparty/glext/glext.h with 100% similarity]
thirdparty/glext/GL/glext.sed [moved from thirdparty/glext/glext.sed with 100% similarity]
thirdparty/glext/GL/glxext.h [moved from thirdparty/glext/glxext.h with 100% similarity]
thirdparty/glext/GL/wglext.h [moved from thirdparty/glext/wglext.h with 100% similarity]

index f25a5dd..5da2bcc 100755 (executable)
@@ -195,8 +195,9 @@ if (QT4_FOUND AND NOT QJSON_FOUND AND (ENABLE_GUI STREQUAL "AUTO"))
     set (QJSON_FOUND TRUE)
 endif ()
 
-# For glext headers
-include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
+# For glext headers.  Needs to be before system includes as often system's GL
+# headers bundle and include glext.h and glxext.h
+include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glext)
 
 # For EGL headers
 include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khr)
index 7207523..1da1261 100644 (file)
@@ -31,7 +31,8 @@
 #define _GLIMPORTS_HPP_
 
 
-// Prevent including system's glext.h
+// Prevent including MacOSX's glext.h which lives in OpenGL/glext.h and not
+// GL/glext.h
 #define __glext_h_
 
 
@@ -76,7 +77,7 @@
 
 // Include our own glext.h
 #undef __glext_h_
-#include "glext/glext.h"
+#include <GL/glext.h>
 
 
 #ifndef GL_TEXTURE_INDEX_SIZE_EXT
@@ -86,7 +87,7 @@
 
 #if defined(_WIN32)
 
-#include "glext/wglext.h"
+#include <GL/wglext.h>
 
 #define GLAPIENTRY __stdcall
 
@@ -139,7 +140,7 @@ CGLError CGLUpdateContext(CGLContextObj ctx);
 
 #ifdef HAVE_X11
 #include <GL/glx.h>
-#include "glext/glxext.h"
+#include <GL/glxext.h>
 #endif
 
 /* Prevent collision with trace::Bool */