Commit 8512cc46 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

cmake: integrate with VTK's module system

parent 65e41dc9
set(sources
src/glew.c)
set(headers
include/GL/glew.h
include/GL/glxew.h
include/GL/wglew.h)
vtk_module_add_module(VTK::glew
SOURCES ${sources}
HEADERS ${headers}
HEADERS_SUBDIR "vtkglew/include/GL")
target_compile_definitions(glew
PRIVATE
GLEW_NO_GLU)
if(VTK_OPENGL_HAS_OSMESA AND UNIX)
target_compile_definitions(glew
PRIVATE
GLEW_OSMESA)
target_link_libraries(glew
PRIVATE
${CMAKE_DL_LIBS})
endif()
if(VTK_OPENGL_HAS_EGL)
target_compile_definitions(glew
PRIVATE
GLEW_EGL)
endif()
if (BUILD_SHARED_LIBS)
if (WIN32)
target_compile_definitions(glew
PRIVATE
GLEW_BUILD)
if(MINGW)
# https://github.com/nigels-com/glew/issues/157
target_link_libraries(glew
PRIVATE
-nostdlib)
# https://discourse.vtk.org/t/1898
target_compile_options(glew
PRIVATE
-minline-all-stringops)
endif()
endif ()
else ()
target_compile_definitions(glew
PUBLIC
GLEW_STATIC)
endif ()
target_include_directories(glew
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
......@@ -7,3 +7,4 @@ symbols to avoid conflicts with other copies of the library within a single
process.
* Ignore whitespace errors to pass VTK's commit checks.
* Integrate the CMake build with VTK's module system.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment