2019-12-10 10:10:46 +00:00
|
|
|
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(GLEW)
|
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
|
|
|
add_library(glew src/glew.c)
|
|
|
|
target_include_directories(glew PRIVATE include/)
|
|
|
|
target_link_libraries(glew PUBLIC OpenGL::GL)
|
|
|
|
|
2019-12-11 11:24:21 +00:00
|
|
|
if (NOT BUILD_SHARED_LIBS)
|
|
|
|
target_compile_definitions(glew PUBLIC GLEW_STATIC)
|
|
|
|
endif ()
|
|
|
|
|
2019-12-10 10:10:46 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${PROJECT_SOURCE_DIR}/include/GL/glew.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/GL/wglew.h
|
|
|
|
${PROJECT_SOURCE_DIR}/include/GL/glxew.h
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_INCLUDEDIR}/GL
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(GLEW INTERFACE)
|
|
|
|
target_link_libraries(GLEW INTERFACE glew)
|
|
|
|
|
|
|
|
install(TARGETS glew GLEW
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
2019-12-11 11:24:21 +00:00
|
|
|
)
|