mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 01:08:48 +02:00
51 lines
No EOL
1.5 KiB
CMake
51 lines
No EOL
1.5 KiB
CMake
#
|
|
# Try to find GLEW library and include path.
|
|
# Once done this will define
|
|
#
|
|
# GLEW_FOUND
|
|
# GLEW_INCLUDE_DIRS
|
|
# GLEW_LIBRARY
|
|
# GLEW_WIN_DLL
|
|
#
|
|
|
|
# Created on 2/6/2014 by Stephen Birarda
|
|
#
|
|
# Adapted from FindGLEW.cmake available in the nvidia-texture-tools repository
|
|
# (https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/cmake/FindGLEW.cmake?r=96)
|
|
|
|
if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARY AND (NOT WIN32 OR GLEW_WIN_DLL))
|
|
set(GLEW_FOUND TRUE)
|
|
else ()
|
|
if (WIN32)
|
|
set(WIN_GLEW_SEARCH_DIRS "${GLEW_ROOT_DIR}" "$ENV{GLEW_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/glew")
|
|
|
|
find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS})
|
|
|
|
if (CMAKE_CL_64)
|
|
set(WIN_ARCH_DIR "x64")
|
|
else()
|
|
set(WIN_ARCH_DIR "Win32")
|
|
endif()
|
|
|
|
find_library(GLEW_LIBRARY glew32 PATH_SUFFIXES "lib/Release/${WIN_ARCH_DIR}" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
|
find_library(GLEW_WIN_DLL glew32 PATH_SUFFIXES "bin/Release/${WIN_ARCH_DIR}" HINTS ${WIN_GLEW_SEARCH_DIRS})
|
|
endif ()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
if (WIN32)
|
|
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY GLEW_WIN_DLL)
|
|
else ()
|
|
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIRS GLEW_LIBRARY)
|
|
endif()
|
|
|
|
if (GLEW_FOUND)
|
|
if (NOT GLEW_FIND_QUIETLY)
|
|
message(STATUS "Found GLEW: ${GLEW_LIBRARY}")
|
|
endif ()
|
|
else ()
|
|
if (GLEW_FIND_REQUIRED)
|
|
message(FATAL_ERROR "Could not find GLEW")
|
|
endif ()
|
|
endif ()
|
|
endif () |