From c8f8ce861635eafe8c7a60a7bb245358d8b2d162 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 18 Jan 2012 09:51:54 +0000 Subject: [PATCH] Force our glxext.h headers to be included instead of the system ones. 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 | 5 +++-- glimports.hpp | 9 +++++---- thirdparty/glext/{ => GL}/Makefile | 0 thirdparty/glext/{ => GL}/glext.h | 0 thirdparty/glext/{ => GL}/glext.sed | 0 thirdparty/glext/{ => GL}/glxext.h | 0 thirdparty/glext/{ => GL}/wglext.h | 0 7 files changed, 8 insertions(+), 6 deletions(-) rename thirdparty/glext/{ => GL}/Makefile (100%) rename thirdparty/glext/{ => GL}/glext.h (100%) rename thirdparty/glext/{ => GL}/glext.sed (100%) rename thirdparty/glext/{ => GL}/glxext.h (100%) rename thirdparty/glext/{ => GL}/wglext.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f25a5dd..5da2bcc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/glimports.hpp b/glimports.hpp index 7207523..1da1261 100644 --- a/glimports.hpp +++ b/glimports.hpp @@ -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 #ifndef GL_TEXTURE_INDEX_SIZE_EXT @@ -86,7 +87,7 @@ #if defined(_WIN32) -#include "glext/wglext.h" +#include #define GLAPIENTRY __stdcall @@ -139,7 +140,7 @@ CGLError CGLUpdateContext(CGLContextObj ctx); #ifdef HAVE_X11 #include -#include "glext/glxext.h" +#include #endif /* Prevent collision with trace::Bool */ diff --git a/thirdparty/glext/Makefile b/thirdparty/glext/GL/Makefile similarity index 100% rename from thirdparty/glext/Makefile rename to thirdparty/glext/GL/Makefile diff --git a/thirdparty/glext/glext.h b/thirdparty/glext/GL/glext.h similarity index 100% rename from thirdparty/glext/glext.h rename to thirdparty/glext/GL/glext.h diff --git a/thirdparty/glext/glext.sed b/thirdparty/glext/GL/glext.sed similarity index 100% rename from thirdparty/glext/glext.sed rename to thirdparty/glext/GL/glext.sed diff --git a/thirdparty/glext/glxext.h b/thirdparty/glext/GL/glxext.h similarity index 100% rename from thirdparty/glext/glxext.h rename to thirdparty/glext/GL/glxext.h diff --git a/thirdparty/glext/wglext.h b/thirdparty/glext/GL/wglext.h similarity index 100% rename from thirdparty/glext/wglext.h rename to thirdparty/glext/GL/wglext.h -- 2.43.0