CMakeLists.txt 847 B

123456789101112131415161718192021222324252627282930313233
  1. cmake_minimum_required(VERSION 3.0)
  2. project(GLEW)
  3. find_package(OpenGL REQUIRED)
  4. add_library(glew src/glew.c)
  5. target_include_directories(glew PRIVATE include/)
  6. target_link_libraries(glew PUBLIC OpenGL::GL)
  7. if (NOT BUILD_SHARED_LIBS)
  8. target_compile_definitions(glew PUBLIC GLEW_STATIC)
  9. endif ()
  10. include(GNUInstallDirs)
  11. install(
  12. FILES
  13. ${PROJECT_SOURCE_DIR}/include/GL/glew.h
  14. ${PROJECT_SOURCE_DIR}/include/GL/wglew.h
  15. ${PROJECT_SOURCE_DIR}/include/GL/glxew.h
  16. DESTINATION
  17. ${CMAKE_INSTALL_INCLUDEDIR}/GL
  18. )
  19. add_library(GLEW INTERFACE)
  20. target_link_libraries(GLEW INTERFACE glew)
  21. install(TARGETS glew GLEW
  22. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  23. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  24. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  25. INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
  26. )