Skip to content

Instantly share code, notes, and snippets.

@dogukanarat
Created May 18, 2024 11:06
Show Gist options
  • Save dogukanarat/021ad274a86da243197bd2f3aa59e98e to your computer and use it in GitHub Desktop.
Save dogukanarat/021ad274a86da243197bd2f3aa59e98e to your computer and use it in GitHub Desktop.
FindGLFW cmake module
# FindGLFW - Find GLFW library
# This module finds if GLFW is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# GLFW_FOUND, if false, do not try to link to GLFW
# GLFW_INCLUDE_DIRS, where to find the headers
# GLFW_LIBRARIES, the libraries to link against
find_library(
GLFW_LIBRARIES
NAMES glfw3 glfw
PATHS
/usr/lib
/usr/local/lib
/usr/lib64
/usr/local/lib64
/opt/local/lib
)
find_path(
GLFW_INCLUDE_DIRS
NAMES GLFW/glfw3.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
)
if (GLFW_LIBRARIES AND GLFW_INCLUDE_DIRS)
set(GLFW_FOUND TRUE)
message(STATUS "Found GLFW: ${GLFW_LIBRARIES} ${GLFW_INCLUDE_DIRS}")
else()
set(GLFW_FOUND FALSE)
message(STATUS "GLFW not found")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment