add option WITH_BUILTIN_GLEW, so linux packagers can disable to use their own glew...
[blender.git] / build_files / cmake / Modules / FindGLEW.cmake
1 #
2 # Try to find GLEW library and include path.
3 # Once done this will define
4 #
5 # GLEW_FOUND
6 # GLEW_INCLUDE_PATH
7 # GLEW_LIBRARY
8
9
10 IF (WIN32)
11         FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
12                 $ENV{PROGRAMFILES}/GLEW/include
13                 ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
14                 DOC "The directory where GL/glew.h resides")
15         IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
16                 FIND_LIBRARY( GLEW_LIBRARY
17                         NAMES glew64 glew64s
18                         PATHS
19                         $ENV{PROGRAMFILES}/GLEW/lib
20                         ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
21                 ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
22                         DOC "The GLEW library (64-bit)"
23                 )
24         ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
25                 FIND_LIBRARY( GLEW_LIBRARY
26                         NAMES glew GLEW glew32 glew32s
27                         PATHS
28                         $ENV{PROGRAMFILES}/GLEW/lib
29                         ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
30                 ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
31                         DOC "The GLEW library"
32                 )
33         ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
34 ELSE (WIN32)
35         FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
36                 /usr/include
37                 /usr/local/include
38                 /sw/include
39                 /opt/local/include
40                 DOC "The directory where GL/glew.h resides")
41         FIND_LIBRARY( GLEW_LIBRARY
42                 NAMES GLEW glew
43                 PATHS
44                 /usr/lib64
45                 /usr/lib
46                 /usr/local/lib64
47                 /usr/local/lib
48                 /sw/lib
49                 /opt/local/lib
50                 DOC "The GLEW library")
51 ENDIF (WIN32)
52
53 IF (GLEW_INCLUDE_PATH)
54         SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
55 ELSE (GLEW_INCLUDE_PATH)
56         SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
57 ENDIF (GLEW_INCLUDE_PATH)
58
59 MARK_AS_ADVANCED( GLEW_FOUND )