FIX: GLU and GLUT flags for Mac OSX
[cmake.git] / Modules / FindGLUT.cmake
blobceb0f1f21eaf23d0015fb1c051c57d1548a74327
2 # Try to find GLUT, once done this will define:
4 # GLUT_INCLUDE_PATH = where the GLUT include directory can be found
5 # GLUT_LIBRARY      = the name of the GLUT library to link with
8 IF (WIN32)
9   IF (CYGWIN)
10     FIND_LIBRARY(GLUT_LIBRARY glut32
11       ${OPENGL_LIBRARY_PATH}
12       /usr/lib/w32api
13       /usr/lib 
14       /usr/local/lib 
15       /usr/X11R6/lib
16     )
17   ELSE (CYGWIN)
18     FIND_LIBRARY(GLUT_LIBRARY glut32
19       ${OPENGL_LIBRARY_PATH}
20     )
21   ENDIF (CYGWIN)
22 ELSE (WIN32)
23   IF (APPLE)
24     SET(GLUT_LIBRARY "-framework Glut" CACHE STRING "GLUT library for OSX")
25   ELSE (APPLE)
26     FIND_PATH(GLUT_INCLUDE_PATH GL/glut.h 
27       ${OPENGL_INCLUDE_PATH}
28       /usr/include 
29       /usr/include/GL
30       /usr/local/include 
31       /usr/openwin/share/include 
32       /opt/graphics/OpenGL/include 
33       /usr/X11R6/include 
34     )
35     MARK_AS_ADVANCED(
36       GLUT_INCLUDE_PATH
37     )
39     FIND_LIBRARY(GLUT_LIBRARY glut
40       ${OPENGL_LIBRARY_PATH}
41       /usr/lib 
42       /usr/local/lib 
43       /opt/graphics/OpenGL/lib 
44       /usr/openwin/lib 
45       /usr/X11R6/lib
46     )
48    ENDIF (APPLE)
49 ENDIF (WIN32)
51 MARK_AS_ADVANCED(
52   GLUT_LIBRARY