openscad/tests/FindGLEW.cmake

50 lines
1.4 KiB
CMake
Raw Normal View History

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
#
# a few lines of this file are based on the LGPL code found at
# http://openlibraries.org/browser/trunk/FindGLEW.cmake?rev=1383
2010-11-08 07:26:55 +03:00
IF (WIN32)
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
# Static linked Release (non-Debug) version
NAMES glew32s.lib
# Dynamic linked Release (non-Debug) version
# NAMES glew32.lib
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-08-28 04:42:37 +04:00
message("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")
2010-11-17 09:26:22 +03:00
MESSAGE(STATUS "GLEW found in " ${GLEW_INCLUDE_PATH} " " ${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)