WtFindGL.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # GL/glew.h X11/Xlib.h X11/Xutil.h GL/gl.h GL/glx.h
  2. IF(WIN32)
  3. SET(GL_INCLUDE_DIR "")
  4. ELSEIF(NOT APPLE)
  5. FIND_PATH(GL_INCLUDE_DIR
  6. NAMES
  7. GL/gl.h
  8. PATHS
  9. /usr/include
  10. )
  11. ENDIF(WIN32)
  12. IF(USE_SYSTEM_GLEW)
  13. FIND_PATH(GLEW_INCLUDE_DIR
  14. NAMES
  15. GL/glew.h
  16. PATHS
  17. src/3rdparty/glew-1.10.0/include
  18. )
  19. ELSE(USE_SYSTEM_GLEW)
  20. SET(GLEW_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/3rdparty/glew-1.10.0/include")
  21. ENDIF(USE_SYSTEM_GLEW)
  22. IF(WIN32)
  23. SET(GL_LIBRARIES Opengl32)
  24. ELSEIF(APPLE)
  25. FIND_LIBRARY(GL_LIBRARIES OpenGL)
  26. ELSEIF(UNIX)
  27. FIND_LIBRARY(GL_LIBRARY GL)
  28. FIND_LIBRARY(X11_LIBRARY X11)
  29. IF(GL_LIBRARY AND X11_LIBRARY)
  30. SET(GL_LIBRARIES ${GL_LIBRARY} ${X11_LIBRARY})
  31. ENDIF(GL_LIBRARY AND X11_LIBRARY)
  32. ENDIF(WIN32)
  33. SET(GL_FOUND FALSE)
  34. IF(WIN32 OR (GL_LIBRARIES AND GL_INCLUDE_DIR AND GLEW_INCLUDE_DIR))
  35. SET(GL_FOUND TRUE)
  36. SET(GL_INCLUDE_DIRS ${GL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR})
  37. ENDIF(WIN32 OR (GL_LIBRARIES AND GL_INCLUDE_DIR AND GLEW_INCLUDE_DIR))
  38. IF(NOT GL_FOUND)
  39. MESSAGE(STATUS "OpenGL libraries not found")
  40. ENDIF(NOT GL_FOUND)