PrusaSlicer-NonPlainar/deps/GLEW/glew/CMakeLists.txt
tamasmeszaros 38aa5cb437 Finding GLEW work in release and debug.
Make building in release and debug in one cmake run on msvc with the prusaslicer_add_cmake_project function.
2019-12-11 12:32:29 +01:00

33 lines
847 B
CMake

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)
if (NOT BUILD_SHARED_LIBS)
target_compile_definitions(glew PUBLIC GLEW_STATIC)
endif ()
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}
)