2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Copyright 2013 Pixar
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Licensed under the Apache License, Version 2.0 (the "Apache License")
|
|
|
|
# with the following modification; you may not use this file except in
|
|
|
|
# compliance with the Apache License and the following modification to it:
|
|
|
|
# Section 6. Trademarks. is deleted and replaced with:
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# 6. Trademarks. This License does not grant permission to use the trade
|
|
|
|
# names, trademarks, service marks, or product names of the Licensor
|
|
|
|
# and its affiliates, except as required to comply with Section 4(c) of
|
|
|
|
# the License and to reproduce the content of the NOTICE file.
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# You may obtain a copy of the Apache License at
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
2013-09-26 19:04:57 +00:00
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the Apache License with the above modification is
|
|
|
|
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the Apache License for the specific
|
|
|
|
# language governing permissions and limitations under the Apache License.
|
2012-06-09 00:06:35 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# Try to find GLEW library and include path.
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# GLEW_FOUND
|
|
|
|
# GLEW_INCLUDE_DIR
|
2012-06-09 20:40:48 +00:00
|
|
|
# GLEW_LIBRARY
|
2012-08-04 02:51:27 +00:00
|
|
|
#
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2012-06-11 23:58:53 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
|
|
|
if (WIN32)
|
2014-09-05 22:07:46 +00:00
|
|
|
|
|
|
|
find_path(GLEW_INCLUDE_DIR
|
2012-08-04 02:51:27 +00:00
|
|
|
NAMES
|
2012-06-14 02:08:03 +00:00
|
|
|
GL/glew.h
|
2012-06-13 21:30:28 +00:00
|
|
|
PATHS
|
2014-04-09 20:43:38 +00:00
|
|
|
"${GLEW_LOCATION}/include"
|
|
|
|
"$ENV{GLEW_LOCATION}/include"
|
|
|
|
"$ENV{PROGRAMFILES}/GLEW/include"
|
|
|
|
"${PROJECT_SOURCE_DIR}/extern/glew/include"
|
2014-09-05 22:07:46 +00:00
|
|
|
DOC "The directory where GL/glew.h resides" )
|
2012-06-14 02:08:03 +00:00
|
|
|
|
2014-09-05 22:07:46 +00:00
|
|
|
if ("${CMAKE_GENERATOR}" MATCHES "[Ww]in64")
|
|
|
|
set(ARCH x64)
|
|
|
|
else()
|
|
|
|
set(ARCH x86)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_library(GLEW_LIBRARY
|
2012-08-04 02:51:27 +00:00
|
|
|
NAMES
|
2012-06-14 21:03:30 +00:00
|
|
|
glew GLEW glew32s glew32
|
2012-06-14 02:08:03 +00:00
|
|
|
PATHS
|
2014-04-09 20:43:38 +00:00
|
|
|
"${GLEW_LOCATION}/lib"
|
|
|
|
"$ENV{GLEW_LOCATION}/lib"
|
|
|
|
"$ENV{PROGRAMFILES}/GLEW/lib"
|
|
|
|
"${PROJECT_SOURCE_DIR}/extern/glew/bin"
|
|
|
|
"${PROJECT_SOURCE_DIR}/extern/glew/lib"
|
2014-09-05 22:07:46 +00:00
|
|
|
PATH_SUFFIXES
|
|
|
|
Release/${ARCH}
|
|
|
|
DOC "The GLEW library")
|
2012-06-13 21:30:28 +00:00
|
|
|
endif ()
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2012-06-11 23:58:53 +00:00
|
|
|
if (${CMAKE_HOST_UNIX})
|
2012-08-04 02:51:27 +00:00
|
|
|
find_path( GLEW_INCLUDE_DIR
|
2012-06-14 02:08:03 +00:00
|
|
|
NAMES
|
|
|
|
GL/glew.h
|
2012-06-11 23:58:53 +00:00
|
|
|
PATHS
|
2014-04-09 20:43:38 +00:00
|
|
|
"${GLEW_LOCATION}/include"
|
|
|
|
"$ENV{GLEW_LOCATION}/include"
|
2012-06-14 02:08:03 +00:00
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
/sw/include
|
|
|
|
/opt/local/include
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
DOC "The directory where GL/glew.h resides"
|
2012-06-11 23:58:53 +00:00
|
|
|
)
|
2012-06-14 02:08:03 +00:00
|
|
|
find_library( GLEW_LIBRARY
|
2012-08-04 02:51:27 +00:00
|
|
|
NAMES
|
2012-06-14 02:08:03 +00:00
|
|
|
GLEW glew
|
|
|
|
PATHS
|
2014-04-09 20:43:38 +00:00
|
|
|
"${GLEW_LOCATION}/lib"
|
|
|
|
"$ENV{GLEW_LOCATION}/lib"
|
2012-06-14 02:08:03 +00:00
|
|
|
/usr/lib64
|
|
|
|
/usr/lib
|
2013-07-24 03:14:40 +00:00
|
|
|
/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
2012-06-14 02:08:03 +00:00
|
|
|
/usr/local/lib64
|
|
|
|
/usr/local/lib
|
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
NO_DEFAULT_PATH
|
|
|
|
DOC "The GLEW library")
|
2012-06-11 23:58:53 +00:00
|
|
|
endif ()
|
2012-06-09 00:06:35 +00:00
|
|
|
|
2012-12-11 01:15:13 +00:00
|
|
|
if (GLEW_INCLUDE_DIR AND EXISTS "${GLEW_INCLUDE_DIR}/GL/glew.h")
|
|
|
|
|
|
|
|
file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" GLEW_4_2 REGEX "^#define GL_VERSION_4_2.*$")
|
|
|
|
if (GLEW_4_2)
|
2013-07-19 02:44:54 +00:00
|
|
|
set(OPENGL_4_2_FOUND TRUE)
|
2012-12-11 01:15:13 +00:00
|
|
|
else ()
|
|
|
|
message(WARNING
|
|
|
|
"glew-1.7.0 or newer needed for supporting OpenGL 4.2 dependent features"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
file(STRINGS "${GLEW_INCLUDE_DIR}/GL/glew.h" GLEW_4_3 REGEX "^#define GL_VERSION_4_3.*$")
|
|
|
|
if (GLEW_4_3)
|
|
|
|
SET(OPENGL_4_3_FOUND TRUE)
|
|
|
|
else ()
|
|
|
|
message(WARNING
|
|
|
|
"glew-1.9.0 or newer needed for supporting OpenGL 4.3 dependent features"
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
endif ()
|
|
|
|
|
2013-07-19 02:44:54 +00:00
|
|
|
find_package_handle_standard_args(GLEW
|
|
|
|
REQUIRED_VARS
|
|
|
|
GLEW_INCLUDE_DIR
|
|
|
|
GLEW_LIBRARY
|
2012-06-09 00:06:35 +00:00
|
|
|
)
|