summaryrefslogtreecommitdiffstats
path: root/Modules/FindOpenGL.cmake
diff options
context:
space:
mode:
authorIan Scott <ian.m.scott@stud.man.ac.uk>2002-09-05 16:00:45 (GMT)
committerIan Scott <ian.m.scott@stud.man.ac.uk>2002-09-05 16:00:45 (GMT)
commit079e8469abd4a2b404fd460ff41012e8d8b6fd1d (patch)
treea920d611d876599e8c04f4a301b5bcf927d6909b /Modules/FindOpenGL.cmake
parent12054916d491d8424b58a87c4ff69679a7f4476d (diff)
downloadCMake-079e8469abd4a2b404fd460ff41012e8d8b6fd1d.zip
CMake-079e8469abd4a2b404fd460ff41012e8d8b6fd1d.tar.gz
CMake-079e8469abd4a2b404fd460ff41012e8d8b6fd1d.tar.bz2
Hide lots of values in the advanced list
Fix some bugs OpenGL always needs X11 on Unix
Diffstat (limited to 'Modules/FindOpenGL.cmake')
-rw-r--r--Modules/FindOpenGL.cmake26
1 files changed, 16 insertions, 10 deletions
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index b2f46dd..aeaf519 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -16,7 +16,6 @@
IF (WIN32)
IF (CYGWIN)
-
FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
/usr/include
/usr/X11R6/include
@@ -56,7 +55,6 @@ IF (WIN32)
ELSE (WIN32)
-
# The first line below is to make sure that the proper headers
# are used on a Linux machine with the NVidia drivers installed.
# They replace Mesa with NVidia's own library but normally do not
@@ -92,6 +90,15 @@ ELSE (WIN32)
/usr/X11R6/lib
)
+# On Unix OpenGL most certainly always requires X11.
+# Feel free to tighten up these conditions if you don't think this is always true.
+ IF (OPENGL_gl_LIBRARY)
+ INCLUDE( ${CMAKE_ROOT}/Modules/FindX11.cmake )
+ IF (X11_FOUND)
+ SET (OPENGL_LIBRARIES ${X11_LIBRARIES})
+ ENDIF (X11_FOUND)
+ ENDIF (OPENGL_gl_LIBRARY)
+
FIND_LIBRARY(OPENGL_glu_LIBRARY
NAMES MesaGLU GLU
PATHS /usr/lib
@@ -101,17 +108,9 @@ ELSE (WIN32)
/usr/X11R6/lib
)
-
-
- ENDIF(OPENGL_glu_LIBRARY)
- ENDIF(OPENGL_gl_LIBRARY)
- ENDIF(OPENGL_INCLUDE_DIR)
-
ENDIF (WIN32)
-
-
SET( OPENGL_FOUND "NO" )
IF(OPENGL_INCLUDE_DIR)
IF(OPENGL_gl_LIBRARY)
@@ -140,3 +139,10 @@ IF(OPENGL_INCLUDE_DIR)
SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
ENDIF(OPENGL_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(
+ OPENGL_INCLUDE_DIR
+ OPENGL_xmesa_INCLUDE_DIR
+ OPENGL_glu_LIBRARY
+ OPENGL_gl_LIBRARY
+)