1 # Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
3 # Redistribution and use is allowed according to the terms of the BSD license.
4 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
6 # - try to find glew library and include files
7 # GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
8 # GLEW_LIBRARIES, the libraries to link against
9 # GLEW_FOUND, If false, do not try to use GLEW.
10 # Also defined, but not for general use are:
11 # GLEW_GLEW_LIBRARY = the full path to the glew library.
17 FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h)
19 FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32
28 FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
29 $ENV{GLEW_ROOT_PATH}/include
32 FIND_LIBRARY( GLEW_GLEW_LIBRARY
35 $ENV{GLEW_ROOT_PATH}/lib
44 # These values for Apple could probably do with improvement.
45 FIND_PATH( GLEW_INCLUDE_DIR glew.h
46 /System/Library/Frameworks/GLEW.framework/Versions/A/Headers
49 SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
50 SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
53 FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
55 /usr/openwin/share/include
59 /opt/graphics/OpenGL/include
60 /opt/graphics/OpenGL/contrib/libglew
63 FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
72 SET( GLEW_FOUND "NO" )
75 # Is -lXi and -lXmu required on all platforms that have it?
76 # If not, we need some way to figure out what platform we are on.
81 SET( GLEW_FOUND "YES" )
83 #The following deprecated settings are for backwards compatibility with CMake1.4
84 SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
85 SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
87 ENDIF(GLEW_GLEW_LIBRARY)
88 ENDIF(GLEW_INCLUDE_DIR)
91 IF(NOT GLEW_FIND_QUIETLY)
92 MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
93 ENDIF(NOT GLEW_FIND_QUIETLY)
95 IF(GLEW_FIND_REQUIRED)
96 MESSAGE(FATAL_ERROR "Could not find Glew")
97 ENDIF(GLEW_FIND_REQUIRED)