1# Locate the glfw library 2# This module defines the following variables: 3# GLFW_LIBRARY, the name of the library; 4# GLFW_INCLUDE_DIR, where to find glfw include files. 5# GLFW_FOUND, true if both the GLFW_LIBRARY and GLFW_INCLUDE_DIR have been found. 6# 7# To help locate the library and include file, you could define an environment variable called 8# GLFW_ROOT which points to the root of the glfw library installation. This is pretty useful 9# on a Windows platform. 10# 11# 12# Usage example to compile an "executable" target to the glfw library: 13# 14# FIND_PACKAGE (glfw REQUIRED) 15# INCLUDE_DIRECTORIES (${GLFW_INCLUDE_DIR}) 16# ADD_EXECUTABLE (executable ${EXECUTABLE_SRCS}) 17# TARGET_LINK_LIBRARIES (executable ${GLFW_LIBRARY}) 18# 19# TODO: 20# Allow the user to select to link to a shared library or to a static library. 21 22#Search for the include file... 23FIND_PATH(GLFW_INCLUDE_DIR glfw3.h DOC "Path to GLFW include directory." 24 HINTS 25 $ENV{GLFW_ROOT} 26 PATH_SUFFIX include/GL include/GLFW #For finding the include file under the root of the glfw expanded archive, typically on Windows. 27 PATHS 28 /usr/include/ 29 /usr/local/include/ 30 # By default headers are under GL subfolder 31 /usr/include/GL 32 /usr/local/include/GL 33 /usr/include/GLFW 34 /usr/local/include/GLFW 35 ${GLFW_ROOT_DIR}/include/ # added by ptr 36 37) 38 39FIND_LIBRARY(GLFW_LIBRARY DOC "Absolute path to GLFW library." 40 NAMES glfw glfw3 GLFW.lib 41 HINTS 42 $ENV{GLFW_ROOT} 43 PATH_SUFFIXES lib/win32 #For finding the library file under the root of the glfw expanded archive, typically on Windows. 44 PATHS 45 /usr/local/lib 46 /usr/lib 47 ${GLFW_ROOT_DIR}/lib-msvc100/release # added by ptr 48) 49 50SET(GLFW_FOUND 0) 51IF(GLFW_LIBRARY AND GLFW_INCLUDE_DIR) 52 SET(GLFW_FOUND 1) 53ENDIF(GLFW_LIBRARY AND GLFW_INCLUDE_DIR) 54