fixed: define build_type before package configure, disable cuda by default
[opensg.git] / CMake / FindGLUT_OpenSG.cmake
blob784dc3dd6f5e61ee5082648f25a7b8b599827c04
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.
11 IF (WIN32)
13   FIND_PATH( GLUT_INCLUDE_DIR NAMES GL/glut.h 
14     PATHS  ${GLUT_ROOT_PATH}/include )
16   FIND_LIBRARY( GLUT_glut_LIBRARY_RELEASE NAMES glut glut32
17     PATHS
18     ${OPENGL_LIBRARY_DIR}
19     ${GLUT_ROOT_PATH}/Release
20     )
22   FIND_LIBRARY( GLUT_glut_LIBRARY_DEBUG NAMES glutd glut32d
23     PATHS
24     ${OPENGL_LIBRARY_DIR}
25     ${GLUT_ROOT_PATH}/Debug
26     )
27 ELSE (WIN32)
29   MESSAGE(ERROR "Only to be used on WIN32 platforms")
30   
31   IF (APPLE)
32     # These values for Apple could probably do with improvement.
33     FIND_PATH( GLUT_INCLUDE_DIR glut.h
34       /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
35       ${OPENGL_LIBRARY_DIR}
36       )
37     SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX") 
38     SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
39   ELSE (APPLE)
40     
41     FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
42       /usr/include/GL
43       /usr/openwin/share/include
44       /usr/openwin/include
45       /opt/graphics/OpenGL/include
46       /opt/graphics/OpenGL/contrib/libglut
47       )
48   
49     FIND_LIBRARY( GLUT_glut_LIBRARY glut
50       /usr/openwin/lib
51       )
52     
53     FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
54       /usr/openwin/lib
55       )
56     
57     FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
58       /usr/openwin/lib
59       )
60     
61   ENDIF (APPLE)
62   
63 ENDIF (WIN32)
65 SET( GLUT_FOUND "NO" )
66 IF(GLUT_INCLUDE_DIR)
67   IF(GLUT_glut_LIBRARY_DEBUG OR GLUT_glut_LIBRARY_RELEASE)
68     # Is -lXi and -lXmu required on all platforms that have it?
69     # If not, we need some way to figure out what platform we are on.
70 #    SET( GLUT_LIBRARIES
71 #      ${GLUT_glut_LIBRARY}
72 #      ${GLUT_Xmu_LIBRARY}
73 #      ${GLUT_Xi_LIBRARY} 
74 #      ${GLUT_cocoa_LIBRARY}
75 #      )
76     SET( GLUT_FOUND "YES" )
77     
78     #The following deprecated settings are for backwards compatibility with CMake1.4
79 #    SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
80     SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
81     
82   ENDIF(GLUT_glut_LIBRARY_DEBUG OR GLUT_glut_LIBRARY_RELEASE)
83 ENDIF(GLUT_INCLUDE_DIR)
85 MARK_AS_ADVANCED(
86   GLUT_INCLUDE_DIR
87   GLUT_glut_LIBRARY_RELEASE
88   GLUT_glut_LIBRARY_DEBUG
89 #  GLUT_Xmu_LIBRARY
90 #  GLUT_Xi_LIBRARY
91   )