FIX: GLU and GLUT flags for Mac OSX
[cmake.git] / Modules / FindOpenGL.cmake
blobda99e9042fdb85cb362b44a1a35d527cb18c8464
2 # Try to find OpenGL, once done this will define:
4 # OPENGL_INCLUDE_PATH = where the GL include directory can be found
5 # OPENGL_LIBRARY      = the name of the OpenGL library to link with
6 # OPENGL_LIBRARY_PATH = where the GL library can be found (might be empty)
9 IF (WIN32)
10   IF(BORLAND)
11     SET (OPENGL_LIBRARY import32 CACHE STRING "OpenGL library for win32")
12   ELSE(BORLAND)
13     SET (OPENGL_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
14   ENDIF(BORLAND)
15 ELSE (WIN32)
16   IF (APPLE)
17     SET(OPENGL_LIBRARY "-framework Carbon -framework AGL -framework OpenGL" CACHE STRING "OpenGL library for OSX")
18   ELSE (APPLE)
19      FIND_PATH(OPENGL_INCLUDE_PATH GL/gl.h 
20        /usr/include 
21        /usr/local/include 
22        /usr/openwin/share/include 
23        /opt/graphics/OpenGL/include 
24        /usr/X11R6/include 
25      )
26      MARK_AS_ADVANCED(
27        OPENGL_INCLUDE_PATH
28      )
30      FIND_LIBRARY(OPENGL_LIBRARY GL
31        /usr/lib 
32        /usr/local/lib 
33        /opt/graphics/OpenGL/lib 
34        /usr/openwin/lib 
35        /usr/X11R6/lib
36      )
38    ENDIF (APPLE)
39 ENDIF (WIN32)
41 GET_FILENAME_COMPONENT (OPENGL_LIBRARY_PATH ${OPENGL_LIBRARY} PATH)
43 MARK_AS_ADVANCED(
44   OPENGL_LIBRARY
45   OPENGL_LIBRARY_PATH