FindGLFW.cmake 877 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # Try to find GLFW library and include path.
  3. # Once done this will define
  4. #
  5. # GLFW_FOUND
  6. # GLFW_INCLUDE_DIR
  7. # GLFW_LIBRARIES
  8. #
  9. FIND_PATH(GLFW_INCLUDE_DIR GLFW/glfw3.h
  10. PATHS
  11. ${PROJECT_SOURCE_DIR}/../../external/glfw/include
  12. /usr/local/include
  13. /usr/X11/include
  14. /usr/include
  15. /opt/local/include
  16. NO_DEFAULT_PATH
  17. )
  18. FIND_LIBRARY( GLFW_LIBRARIES NAMES glfw glfw3
  19. PATHS
  20. ${PROJECT_SOURCE_DIR}/../../external/glfw/src
  21. ${PROJECT_SOURCE_DIR}/../../external/glfw/lib/x64
  22. /usr/local
  23. /usr/X11
  24. /usr
  25. PATH_SUFFIXES
  26. a
  27. lib64
  28. lib
  29. NO_DEFAULT_PATH
  30. )
  31. SET(GLFW_FOUND "NO")
  32. IF (GLFW_INCLUDE_DIR AND GLFW_LIBRARIES)
  33. SET(GLFW_FOUND "YES")
  34. ENDIF (GLFW_INCLUDE_DIR AND GLFW_LIBRARIES)
  35. if(GLFW_FOUND)
  36. message(STATUS "Found GLFW: ${GLFW_INCLUDE_DIR}")
  37. else(GLFW_FOUND)
  38. message(FATAL_ERROR "could NOT find GLFW")
  39. endif(GLFW_FOUND)