FindGLEW.cmake 706 B

123456789101112131415161718192021222324252627282930313233
  1. include(FindPkgConfig OPTIONAL)
  2. # This is a hack to deal with Ubuntu's mess.
  3. # Ubuntu's version of glew is 1.8, but they have patched in most of glew 1.9.
  4. # So Ubuntu's version works for dolphin.
  5. macro(test_glew)
  6. set(CMAKE_REQUIRED_INCLUDES ${GLEW_INCLUDE_DIRS})
  7. set(CMAKE_REQUIRED_LIBRARIES GLEW)
  8. check_cxx_source_runs("
  9. #include <GL/glew.h>
  10. int main()
  11. {
  12. #ifdef GLEW_ARB_shader_image_load_store
  13. return 0;
  14. #else
  15. return 1;
  16. #endif
  17. }"
  18. GLEW_HAS_1_9_METHODS)
  19. endmacro()
  20. if(PKG_CONFIG_FOUND AND NOT ${var}_FOUND)
  21. pkg_search_module(GLEW glew>=1.8)
  22. endif()
  23. if(GLEW_FOUND)
  24. test_glew()
  25. if (GLEW_HAS_1_9_METHODS)
  26. include_directories(${GLEW_INCLUDE_DIRS})
  27. message("GLEW found")
  28. endif()
  29. endif()