2010-11-08 07:26:55 +03:00
|
|
|
#
|
|
|
|
# Try to find GLEW library and include path.
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# GLEW_FOUND
|
|
|
|
# GLEW_INCLUDE_PATH
|
|
|
|
# GLEW_LIBRARY
|
|
|
|
#
|
|
|
|
|
2011-08-28 02:11:47 +04:00
|
|
|
# a few lines of this file are based on the LGPL code found at
|
|
|
|
# http://openlibraries.org/browser/trunk/FindGLEW.cmake?rev=1383
|
|
|
|
|
2011-10-16 00:48:41 +04:00
|
|
|
|
2010-11-08 07:26:55 +03:00
|
|
|
IF (WIN32)
|
2011-10-16 00:48:41 +04:00
|
|
|
IF (WIN32_STATIC_BUILD) # passed from caller
|
|
|
|
SET(GLEW_LIB_SEARCH_NAME glew32s.lib) # static, non-debug (Release)
|
|
|
|
ELSE ()
|
|
|
|
SET(GLEW_LIB_SEARCH_NAME glew32.lib) # other. untested with OpenSCAD
|
|
|
|
ENDIF()
|
|
|
|
|
2010-11-08 07:26:55 +03:00
|
|
|
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
|
|
|
$ENV{PROGRAMFILES}/GLEW/include
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
|
|
|
|
DOC "The directory where GL/glew.h resides")
|
|
|
|
FIND_LIBRARY( GLEW_LIBRARY
|
2011-10-16 00:48:41 +04:00
|
|
|
NAMES ${GLEW_LIB_SEARCH_NAME}
|
2010-11-08 07:26:55 +03:00
|
|
|
PATHS
|
|
|
|
$ENV{PROGRAMFILES}/GLEW/lib
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
|
|
|
|
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
|
|
|
|
DOC "The GLEW library")
|
|
|
|
ELSE (WIN32)
|
2011-11-05 04:27:46 +04:00
|
|
|
message(STATUS "GLEW_DIR: " ${GLEW_DIR})
|
2010-11-08 07:26:55 +03:00
|
|
|
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
|
2011-08-28 04:42:37 +04:00
|
|
|
PATHS ${GLEW_DIR}/include /usr/include /usr/local/include
|
2010-11-17 09:26:22 +03:00
|
|
|
NO_DEFAULT_PATH
|
2010-11-08 07:26:55 +03:00
|
|
|
DOC "The directory where GL/glew.h resides")
|
|
|
|
FIND_LIBRARY( GLEW_LIBRARY
|
|
|
|
NAMES GLEW glew
|
2011-08-28 04:42:37 +04:00
|
|
|
PATHS ${GLEW_DIR}/lib /usr/lib /usr/local/lib
|
2010-11-17 09:26:22 +03:00
|
|
|
NO_DEFAULT_PATH
|
2010-11-08 07:26:55 +03:00
|
|
|
DOC "The GLEW library")
|
|
|
|
ENDIF (WIN32)
|
|
|
|
|
|
|
|
IF (GLEW_INCLUDE_PATH)
|
|
|
|
SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
2011-12-01 08:24:14 +04:00
|
|
|
MESSAGE(STATUS "GLEW include found in " ${GLEW_INCLUDE_PATH} )
|
|
|
|
MESSAGE(STATUS "GLEW library found in " ${GLEW_LIBRARY} )
|
2010-11-08 07:26:55 +03:00
|
|
|
ELSE (GLEW_INCLUDE_PATH)
|
|
|
|
SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
|
|
|
|
ENDIF (GLEW_INCLUDE_PATH)
|