cmake_modules/FindGLEW.cmake
branchwebgl
changeset 8448 14f736ca7eb3
parent 7997 7dff08baf9e3
child 9201 bcf2f7798ebb
equal deleted inserted replaced
8446:c18ba8726f5a 8448:14f736ca7eb3
     1 #
     1 #
     2 # Try to find GLEW library and include path.
     2 # Try to find GLEW library and include path.
     3 # Once done this will define
     3 # Once done this will define
     4 #
     4 #
     5 # GLEW_FOUND
     5 # GLEW_FOUND
     6 # GLEW_INCLUDE_PATH
     6 # GLEW_INCLUDE_DIRS
     7 # GLEW_LIBRARY
     7 # GLEW_LIBRARY
     8 # 
     8 # 
     9 
     9 
    10 if (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    10 if (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    11   # in cache already
    11   # in cache already
    12   set(GLEW_FOUND TRUE)
    12   set(GLEW_FOUND TRUE)
    13 else (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    13 else (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    14 
    14 
    15     IF (WIN32)
    15     IF (WIN32)
    16         FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
    16         FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h
    17             $ENV{PROGRAMFILES}/GLEW/include
    17             $ENV{PROGRAMFILES}/GLEW/include
    18             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
    18             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
    19             DOC "The directory where GL/glew.h resides")
    19             DOC "The directory where GL/glew.h resides")
    20         FIND_LIBRARY( GLEW_LIBRARY
    20         FIND_LIBRARY( GLEW_LIBRARY
    21             NAMES glew GLEW glew32 glew32s
    21             NAMES glew GLEW glew32 glew32s
    23             $ENV{PROGRAMFILES}/GLEW/lib
    23             $ENV{PROGRAMFILES}/GLEW/lib
    24             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
    24             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
    25             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
    25             ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
    26         DOC "The GLEW library")
    26         DOC "The GLEW library")
    27     ELSE (WIN32)
    27     ELSE (WIN32)
    28         FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
    28         FIND_PATH( GLEW_INCLUDE_DIRS GL/glew.h
    29             /usr/include
    29             /usr/include
    30             /usr/local/include
    30             /usr/local/include
    31             /sw/include
    31             /sw/include
    32             /opt/local/include
    32             /opt/local/include
    33             DOC "The directory where GL/glew.h resides")
    33             DOC "The directory where GL/glew.h resides")
    41             /sw/lib
    41             /sw/lib
    42             /opt/local/lib
    42             /opt/local/lib
    43             DOC "The GLEW library")
    43             DOC "The GLEW library")
    44     ENDIF (WIN32)
    44     ENDIF (WIN32)
    45 
    45 
    46     IF (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    46     IF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    47         SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
    47         SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
    48     ELSE (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    48     ELSE (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    49         SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
    49         SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
    50     ENDIF (GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    50     ENDIF (GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    51 
    51 
    52 endif(GLEW_LIBRARY AND GLEW_INCLUDE_PATH)
    52 endif(GLEW_LIBRARY AND GLEW_INCLUDE_DIRS)
    53 
    53 
    54 if (GLEW_FOUND)
    54 if (GLEW_FOUND)
    55     if (NOT GLEW_FIND_QUIETLY)
    55     if (NOT GLEW_FIND_QUIETLY)
    56         message(STATUS "Found GLEW: ${GLEW_LIBRARY}, ${GLEW_INCLUDE_PATH}")
    56         message(STATUS "Found GLEW: ${GLEW_LIBRARY}, ${GLEW_INCLUDE_DIRS}")
    57     endif (NOT GLEW_FIND_QUIETLY)
    57     endif (NOT GLEW_FIND_QUIETLY)
    58 else (GLEW_FOUND)
    58 else (GLEW_FOUND)
    59     if (GLEW_FIND_REQUIRED)
    59     if (GLEW_FIND_REQUIRED)
    60         message(FATAL_ERROR "Could NOT find GLEW")
    60         message(FATAL_ERROR "Could NOT find GLEW")
    61     endif (GLEW_FIND_REQUIRED)
    61     endif (GLEW_FIND_REQUIRED)
    62 endif (GLEW_FOUND)
    62 endif (GLEW_FOUND)
    63 
    63 
    64 #MARK_AS_ADVANCED( GLEW_FOUND )
    64 #MARK_AS_ADVANCED( GLEW_FOUND )
       
    65