Skip to content

Instantly share code, notes, and snippets.

@dogukanarat
Created May 18, 2024 11:05
Show Gist options
  • Save dogukanarat/4f16d40c3007d648e4a64a59c3dbe917 to your computer and use it in GitHub Desktop.
Save dogukanarat/4f16d40c3007d648e4a64a59c3dbe917 to your computer and use it in GitHub Desktop.
FindGLEW cmake module
# FindGLEW - Find GLEW library
# This module finds if GLEW is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# GLEW_FOUND, if false, do not try to link to GLEW
# GLEW_INCLUDE_DIRS, where to find the headers
# GLEW_LIBRARIES, the libraries to link against
find_library(
GLEW_LIBRARIES
NAMES glew GLEW glew32 glew32s
PATHS
/usr/lib
/usr/local/lib
/usr/lib64
/usr/local/lib64
/opt/local/lib
)
find_path(
GLEW_INCLUDE_DIRS
NAMES GL/glew.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
)
if (GLEW_LIBRARIES AND GLEW_INCLUDE_DIRS)
set(GLEW_FOUND TRUE)
message(STATUS "Found GLEW: ${GLEW_LIBRARIES} ${GLEW_INCLUDE_DIRS}")
else()
set(GLEW_FOUND FALSE)
message(STATUS "Could not find GLEW")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment