Commit 9127f47e44d73f4d60e954353eeb60ee2019305e

Authored by David Mayerich
1 parent fdc7f32c

added a CMake file for GLFW

Showing 1 changed file with 68 additions and 0 deletions   Show diff stats
cmake/FindGLFW.cmake 0 → 100644
  1 +# Find GLFW 3
  2 +#
  3 +# GLFW_LIBRARIES
  4 +# GLFW_INCLUDE_DIRS.
  5 +# GLFW_FOUND
  6 +set(GLFW_ROOT $ENV{GLFW_ROOT})
  7 +IF(NOT UNIX)
  8 + IF(NOT GLFW_ROOT)
  9 + MESSAGE("ERROR: GLFW_ROOT must be set!")
  10 + ENDIF(NOT GLFW_ROOT)
  11 +
  12 + FIND_PATH(GLFW_INCLUDE_DIRS DOC "Path to GLFW include directory."
  13 + NAMES GLFW/glfw3.h
  14 + PATHS ${GLFW_ROOT}/include)
  15 + IF(MSVC15)
  16 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  17 + NAMES glfw3.lib
  18 + PATHS ${GLFW_ROOT}/lib-vc2015)
  19 + ELSEIF(MSVC13)
  20 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  21 + NAMES glfw3.lib
  22 + PATHS ${GLFW_ROOT}/lib-vc2013)
  23 + ELSEIF(MSVC12)
  24 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  25 + NAMES glfw3.lib
  26 + PATHS ${GLFW_ROOT}/lib-vc2012)
  27 + ELSEIF(MSVC10)
  28 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  29 + NAMES glfw3.lib
  30 + PATHS ${GLFW_ROOT}/lib-vc2010)
  31 + ELSEIF(MINGW)
  32 + IF(CMAKE_CL_64)
  33 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  34 + NAMES glfw3.dll
  35 + PATHS ${GLFW_ROOT}/lib-mingw-w64)
  36 + ELSE(CMAKE_CL_64)
  37 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  38 + NAMES glfw3.dll
  39 + PATHS ${GLFW_ROOT}/lib-mingw)
  40 + ENDIF(CMAKE_CL_64)
  41 + ELSE(MINGW)
  42 + # Default to latest version of VC libs
  43 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  44 + NAMES glfw3.lib
  45 + PATHS ${GLFW_ROOT}/lib-vc2015)
  46 + ENDIF(MSVC15)
  47 +ELSE(NOT UNIX)
  48 + FIND_PATH(GLFW_INCLUDE_DIRS DOC "Path to GLFW include directory."
  49 + NAMES GLFW/glfw3.h
  50 + PATHS
  51 + /usr/include
  52 + /usr/local/include
  53 + /usr/target/include
  54 + /sw/include
  55 + /opt/local/include)
  56 +
  57 + FIND_LIBRARY(GLFW_LIBRARIES DOC "Absolute path to GLFW library."
  58 + NAMES glfw3.dll
  59 + PATHS
  60 + /usr/local/lib
  61 + /usr/lib
  62 + /lib)
  63 +ENDIF(NOT UNIX)
  64 +
  65 +include(FindPackageHandleStandardArgs)
  66 +find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_LIBRARIES GLFW_INCLUDE_DIRS)
  67 +
  68 +mark_as_advanced(GLFW_INCLUDE_DIRS GLFW_LIBRARIES)
... ...