Gl/glx.h often includes GL/glxext.h, which may be outdated.
So manipulate the include path so that our headers are found first.
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)
#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_
// Include our own glext.h
#undef __glext_h_
-#include "glext/glext.h"
+#include <GL/glext.h>
#ifndef GL_TEXTURE_INDEX_SIZE_EXT
#if defined(_WIN32)
-#include "glext/wglext.h"
+#include <GL/wglext.h>
#define GLAPIENTRY __stdcall
#ifdef HAVE_X11
#include <GL/glx.h>
-#include "glext/glxext.h"
+#include <GL/glxext.h>
#endif
/* Prevent collision with trace::Bool */