Skip to content
Snippets Groups Projects
Commit 2fd6db9b authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'revert_mr_1427'


196b115e Revert "Added more flags for using OpenGL libraries"

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: default avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !1476
parents acd0c91e 196b115e
No related branches found
No related tags found
No related merge requests found
......@@ -18,11 +18,7 @@ option(VTK_USE_X "Use X for VTK render windows" ${VTK_USE_X_DEFAULT})
# OSMesa logic for offscreen mesa rendering.
option(VTK_OPENGL_HAS_OSMESA
"The OpenGL library being used supports / can be combined with off screen Mesa calls" OFF)
# OSMesa offscreen mesa rendering.
option(VTK_USE_OSMESA
"Use OSMesa for off screen rendering." OFF)
"The OpenGL library being used supports off screen Mesa calls" OFF)
# EGL offscreen rendering
option(VTK_USE_OFFSCREEN_EGL
"Use EGL for OpenGL client API for offscreen rendering." OFF)
......@@ -37,29 +33,33 @@ if (VTK_USE_OFFSCREEN_EGL AND ANDROID)
endif()
option(VTK_USE_OFFSCREEN "Use off screen calls by default" OFF)
if(VTK_USE_X OR VTK_USE_COCOA OR WIN32 OR ANDROID OR APPLE_IOS OR VTK_USE_OSMESA)
unset(VTK_CAN_DO_OFFSCREEN)
if(VTK_OPENGL_HAS_OSMESA OR WIN32 OR VTK_USE_OFFSCREEN_EGL)
set(VTK_CAN_DO_OFFSCREEN 1)
endif()
if(VTK_USE_X OR VTK_USE_COCOA OR WIN32 OR ANDROID OR APPLE_IOS)
set(VTK_USE_OSMESA FALSE)
if (VTK_USE_OFFSCREEN_EGL)
message(FATAL_ERROR "VTK_USE_OFFSCREEN_EGL set together with one of ("
"VTK_USE_X, VTK_USE_COCOA, VTK_USE_OSMESA, WIN32, ANDROID OR APPLE_IOS). "
"You cannot use both offscreen and one of the listed windowing systems or "
"alternative offscreen rendering backends.")
"VTK_USE_X, VTK_USE_COCOA, WIN32, ANDROID OR APPLE_IOS). "
"You cannot use both offscreen and one of the listed windowing systems.")
endif()
elseif(VTK_USE_OFFSCREEN_EGL)
set(VTK_USE_OSMESA FALSE)
else()
set(VTK_USE_OSMESA TRUE)
endif()
mark_as_advanced(VTK_USE_X VTK_OPENGL_HAS_OSMESA VTK_USE_OSMESA VTK_USE_OFFSCREEN_EGL
mark_as_advanced(VTK_USE_X VTK_OPENGL_HAS_OSMESA VTK_USE_OFFSCREEN_EGL
VTK_USE_OFFSCREEN VTK_EGL_DEVICE_INDEX)
if(VTK_USE_OSMESA)
find_package(OSMesa REQUIRED)
include_directories(SYSTEM ${OSMESA_INCLUDE_DIR})
endif()
if(VTK_USE_OFFSCREEN_EGL)
find_package(OSMesa REQUIRED)
include_directories(SYSTEM ${OSMESA_INCLUDE_DIR})
elseif(VTK_USE_OFFSCREEN_EGL)
find_package(EGL REQUIRED)
include_directories(SYSTEM ${EGL_INCLUDE_DIR})
endif()
if(VTK_USE_X OR VTK_USE_COCOA OR WIN32 OR ANDROID OR APPLE_IOS)
else()
find_package(OpenGL REQUIRED)
include_directories(SYSTEM ${OPENGL_INCLUDE_DIR})
if(APPLE)
......@@ -80,18 +80,12 @@ if(VTK_USE_X OR VTK_USE_COCOA OR WIN32 OR ANDROID OR APPLE_IOS)
endif()
# Function to link a VTK target to the necessary OpenGL libraries.
set(VTK_OPENGL_LINK_LIBRARIES)
if(VTK_USE_OFFSCREEN_EGL)
set(VTK_OPENGL_LINK_LIBRARIES ${VTK_OPENGL_LINK_LIBRARIES} ${EGL_LIBRARIES})
endif()
if(VTK_USE_OSMESA)
set(VTK_OPENGL_LINK_LIBRARIES ${VTK_OPENGL_LINK_LIBRARIES} ${OSMESA_LIBRARY})
endif()
if(VTK_USE_X OR VTK_USE_COCOA OR WIN32 OR ANDROID OR APPLE_IOS)
set(VTK_OPENGL_LINK_LIBRARIES ${VTK_OPENGL_LINK_LIBRARIES} ${OPENGL_LIBRARIES})
endif()
function(vtk_opengl_link target)
vtk_module_link_libraries(${target} LINK_PRIVATE ${VTK_OPENGL_LINK_LIBRARIES})
if(VTK_USE_OSMESA)
vtk_module_link_libraries(${target} LINK_PRIVATE ${OSMESA_LIBRARY})
elseif(VTK_USE_OFFSCREEN_EGL)
vtk_module_link_libraries(${target} LINK_PRIVATE ${EGL_LIBRARIES})
else()
vtk_module_link_libraries(${target} LINK_PRIVATE ${OPENGL_LIBRARIES})
endif()
endfunction()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment