ENH: typo
[cmake.git] / Modules / FindGLUT.cmake
blobad1d5b5b18cb875ff9853400448a23a17a2e6e3c
1 # - try to find glut library and include files
2 #  GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
3 #  GLUT_LIBRARIES, the libraries to link against
4 #  GLUT_FOUND, If false, do not try to use GLUT.
5 # Also defined, but not for general use are:
6 #  GLUT_glut_LIBRARY = the full path to the glut library.
7 #  GLUT_Xmu_LIBRARY  = the full path to the Xmu library.
8 #  GLUT_Xi_LIBRARY   = the full path to the Xi Library.
10 IF (WIN32)
12   IF(CYGWIN)
14     FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h )
16     FIND_LIBRARY( GLUT_glut_LIBRARY glut32
17       ${OPENGL_LIBRARY_DIR}
18     )
21   ELSE(CYGWIN)
23     FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
24       ${GLUT_ROOT_PATH}/include
25     )
27     FIND_LIBRARY( GLUT_glut_LIBRARY glut
28       ${GLUT_ROOT_PATH}/Release
29       ${OPENGL_LIBRARY_DIR}
30     )
32   ENDIF(CYGWIN)
34 ELSE (WIN32)
36   IF (APPLE)
37 # These values for Apple could probably do with improvement.
38     FIND_PATH( GLUT_INCLUDE_DIR glut.h
39       /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
40       ${OPENGL_LIBRARY_DIR}
41     )
42     SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX") 
43     SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
44   ELSE (APPLE)
46     FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
47       /usr/include/GL
48       /usr/openwin/share/include
49       /usr/openwin/include
50       /opt/graphics/OpenGL/include
51       /opt/graphics/OpenGL/contrib/libglut
52     )
54     FIND_LIBRARY( GLUT_glut_LIBRARY glut
55       /usr/openwin/lib
56     )
58     FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
59       /usr/openwin/lib
60     )
62     FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
63       /usr/openwin/lib
64     )
66   ENDIF (APPLE)
68 ENDIF (WIN32)
70 SET( GLUT_FOUND "NO" )
71 IF(GLUT_INCLUDE_DIR)
72   IF(GLUT_glut_LIBRARY)
73     # Is -lXi and -lXmu required on all platforms that have it?
74     # If not, we need some way to figure out what platform we are on.
75     SET( GLUT_LIBRARIES
76       ${GLUT_glut_LIBRARY}
77       ${GLUT_Xmu_LIBRARY}
78       ${GLUT_Xi_LIBRARY} 
79       ${GLUT_cocoa_LIBRARY}
80     )
81     SET( GLUT_FOUND "YES" )
83 #The following deprecated settings are for backwards compatibility with CMake1.4
84     SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
85     SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
87   ENDIF(GLUT_glut_LIBRARY)
88 ENDIF(GLUT_INCLUDE_DIR)
90 MARK_AS_ADVANCED(
91   GLUT_INCLUDE_DIR
92   GLUT_glut_LIBRARY
93   GLUT_Xmu_LIBRARY
94   GLUT_Xi_LIBRARY