FindGLEW.cmake 877 B

12345678910111213141516171819202122232425262728
  1. find_path(GLEW_INCLUDE_DIR
  2. NAMES GL/glew.h
  3. DOC "glew include directory")
  4. mark_as_advanced(GLEW_INCLUDE_DIR)
  5. find_library(GLEW_LIBRARY
  6. NAMES GLEW glew32
  7. DOC "glew library")
  8. mark_as_advanced(GLEW_LIBRARY)
  9. include(FindPackageHandleStandardArgs)
  10. find_package_handle_standard_args(GLEW REQUIRED_VARS GLEW_LIBRARY GLEW_INCLUDE_DIR)
  11. if (GLEW_FOUND)
  12. set(GLEW_INCLUDE_DIRS "${GLEW_INCLUDE_DIR}")
  13. set(GLEW_LIBRARIES "${GLEW_LIBRARY}")
  14. if (NOT TARGET GLEW::GLEW)
  15. include(vtkDetectLibraryType)
  16. vtk_detect_library_type(glew_library_type
  17. PATH "${GLEW_LIBRARY}")
  18. add_library(GLEW::GLEW "${glew_library_type}" IMPORTED)
  19. unset(glew_library_type)
  20. set_target_properties(GLEW::GLEW PROPERTIES
  21. IMPORTED_LOCATION "${GLEW_LIBRARY}"
  22. IMPORTED_IMPLIB "${GLEW_LIBRARY}"
  23. INTERFACE_INCLUDE_DIRECTORIES "${GLEW_INCLUDE_DIR}")
  24. endif ()
  25. endif ()