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