[Piglit] [PATCH 03/10] CMakeLists: only find GLEXT paths if OpenGL is also found

Daniel Kurtz djkurtz at chromium.org
Wed Jan 15 03:09:58 PST 2014


If there is no OpenGL, there won't be OpenGL extensions either, so don't
look for them.  It is better to just leave GLEXT_INCLUDE_DIR undefined,
so it can be safely added to the list of include directories used for
building tests and utils that can be built either with or without Desktop
GL.

Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
 CMakeLists.txt | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6620b98..01b8ec7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -267,19 +267,21 @@ if (WIN32)
 	add_definitions (-D_USE_MATH_DEFINES)
 endif (WIN32)
 
-if (APPLE)
-	find_path(GLEXT_INCLUDE_DIR
-		NAMES OpenGL/glext.h
-		PATHS ${OPENGL_INCLUDE_DIR}
-		DOC "Include for OpenGL/glext.h on OSX"
-	)
-else (APPLE)
-	find_path(GLEXT_INCLUDE_DIR
-		NAMES GL/glext.h
-		PATHS ${OPENGL_INCLUDE_DIR}
-		DOC "Include for GL/glext.h"
-	)
-endif (APPLE)
+if (OPENGL_FOUND)
+	if (APPLE)
+		find_path(GLEXT_INCLUDE_DIR
+			NAMES OpenGL/glext.h
+			PATHS ${OPENGL_INCLUDE_DIR}
+			DOC "Include for OpenGL/glext.h on OSX"
+		)
+	else (APPLE)
+		find_path(GLEXT_INCLUDE_DIR
+			NAMES GL/glext.h
+			PATHS ${OPENGL_INCLUDE_DIR}
+			DOC "Include for GL/glext.h"
+		)
+	endif (APPLE)
+endif()
 
 FIND_LIBRARY(HAVE_LIBRT NAMES rt)
 if(HAVE_LIBRT)
-- 
1.8.5.2



More information about the Piglit mailing list