author | unc0rr |
Sat, 15 Jun 2013 23:44:37 +0400 | |
branch | webgl |
changeset 9164 | d923ba9d1145 |
parent 8448 | 14f736ca7eb3 |
child 9201 | bcf2f7798ebb |
permissions | -rw-r--r-- |
7997 | 1 |
# |
2 |
# Try to find GLEW library and include path. |
|
3 |
# Once done this will define |
|
4 |
# |
|
5 |
# GLEW_FOUND |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
6 |
# GLEW_INCLUDE_DIRS |
7997 | 7 |
# GLEW_LIBRARY |
8 |
# |
|
9 |
||
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
10 |
if (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 11 |
# in cache already |
12 |
set(GLEW_FOUND TRUE) |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
13 |
else (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 14 |
|
15 |
IF (WIN32) |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
16 |
FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h |
7997 | 17 |
$ENV{PROGRAMFILES}/GLEW/include |
18 |
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include |
|
19 |
DOC "The directory where GL/glew.h resides") |
|
20 |
FIND_LIBRARY( GLEW_LIBRARY |
|
21 |
NAMES glew GLEW glew32 glew32s |
|
22 |
PATHS |
|
23 |
$ENV{PROGRAMFILES}/GLEW/lib |
|
24 |
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin |
|
25 |
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib |
|
26 |
DOC "The GLEW library") |
|
27 |
ELSE (WIN32) |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
28 |
FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h |
7997 | 29 |
/usr/include |
30 |
/usr/local/include |
|
31 |
/sw/include |
|
32 |
/opt/local/include |
|
33 |
DOC "The directory where GL/glew.h resides") |
|
34 |
FIND_LIBRARY( GLEW_LIBRARY |
|
35 |
NAMES GLEW glew |
|
36 |
PATHS |
|
37 |
/usr/lib64 |
|
38 |
/usr/lib |
|
39 |
/usr/local/lib64 |
|
40 |
/usr/local/lib |
|
41 |
/sw/lib |
|
42 |
/opt/local/lib |
|
43 |
DOC "The GLEW library") |
|
44 |
ENDIF (WIN32) |
|
45 |
||
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
46 |
IF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 47 |
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") |
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
48 |
ELSE (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 49 |
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise") |
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
50 |
ENDIF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 51 |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
52 |
endif(GLEW_LIBRARY AND GLEW_INCLUDE_DIRS) |
7997 | 53 |
|
54 |
if (GLEW_FOUND) |
|
55 |
if (NOT GLEW_FIND_QUIETLY) |
|
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
56 |
message(STATUS "Found GLEW: ${GLEW_LIBRARY}, ${GLEW_INCLUDE_DIRS}") |
7997 | 57 |
endif (NOT GLEW_FIND_QUIETLY) |
58 |
else (GLEW_FOUND) |
|
59 |
if (GLEW_FIND_REQUIRED) |
|
60 |
message(FATAL_ERROR "Could NOT find GLEW") |
|
61 |
endif (GLEW_FIND_REQUIRED) |
|
62 |
endif (GLEW_FOUND) |
|
63 |
||
8448
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
64 |
#MARK_AS_ADVANCED( GLEW_FOUND ) |
14f736ca7eb3
update FindGLEW to use the same variables as in later CMake files and make sure to include its headers before compiling c stuff
koda
parents:
7997
diff
changeset
|
65 |