FindGLEW.cmake 2.03 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# File from https://github.com/progschj/OpenGL-Examples/
#
# ----------------------------------------------------------------------------
# Copyright (c) 2012-2013 Jakob Progsch
# Released under ZLib license:
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from the
# use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
#    claim that you wrote the original software. If you use this software in
#    a product, an acknowledgment in the product documentation would be
#    appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be
#    misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
# ----------------------------------------------------------------------------
#
# NOTE: This file was removed from OpenGL-Examples project on 2013-11-01:
#       https://github.com/progschj/OpenGL-Examples/commit/a100ce1ec6f5f6acf6ba3a3279cd3b3b91775b20
28 29 30
#
# Try to find GLEW library and include path.
# Once done this will define
31
#rewritten for OTB by Rashad Kanavath
32 33 34 35
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
36
#
37

38 39 40 41
find_path(
  GLEW_INCLUDE_DIR GL/glew.h
  DOC "The directory where GL/glew.h resides"
  )
42

43 44 45 46 47
if(WIN32)
  set(GLEW_LIB_NAMES glew GLEW glew32 glew32s)
else()
  set(GLEW_LIB_NAMES libGLEW GLEW)
endif()
48

49 50 51
FIND_LIBRARY( GLEW_LIBRARY
  NAMES ${GLEW_LIB_NAMES}
  DOC "The GLEW library")
52

53 54 55 56 57
set(GLEW_FOUND FALSE)
if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
  set(GLEW_LIBRARIES ${GLEW_LIBRARY})
  set(GLEW_FOUND TRUE)
endif()
58 59

INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
60
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW
61 62
  REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR
  VERSION_VAR GLEW_VERSION_STRING)