Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.10)

project(VTKPythonPackage NONE)

Expand Down Expand Up @@ -61,6 +61,23 @@ if(VTKPythonPackage_SUPERBUILD)
option(VTK_Group_Web "Build VTK web module" OFF)
mark_as_advanced(VTK_Group_Web)

option(VTK_OPENGL_HAS_EGL "Use EGL for offscreen rendering" OFF)
mark_as_advanced(VTK_OPENGL_HAS_EGL)

# This is a Linux only option and the valid values can be either
# "LEGACY" or "GLVND". More information here:
# https://cmake.org/cmake/help/git-stage/policy/CMP0072.html
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing, since was introduced in CMake 3.11 ... could you also bump the minimum CMake version from 3.3 to 3.11 ?

See https://cmake.org/cmake/help/v3.13/manual/cmake-policies.7.html#policies-introduced-by-cmake-3-11

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, doesn't it only say that with 3.11 the default changes from legacy to glvnd? It doesn't say that the option is not valid before 3.11.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. That would be 3.10 then, see https://cmake.org/cmake/help/v3.10/release/3.10.html#modules

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanks.

if(UNIX AND NOT APPLE)
set(OpenGL_GL_PREFERENCE "LEGACY" CACHE STRING "Set the preferred OpenGL library")

if(NOT OpenGL_GL_PREFERENCE MATCHES "^(LEGACY|GLVND)$")
message(FATAL_ERROR "Unknown value for OpenGL_GL_PREFERENCE. Valid values are LEGACY or GLVND")
endif()

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "LEGACY" "GLVND")
endif()

option(VTK_OPENGL_HAS_OSMESA "Use OSMesa for offscreen rendering" OFF)
mark_as_advanced(VTK_OPENGL_HAS_OSMESA)
if(VTK_OPENGL_HAS_OSMESA OR APPLE OR WIN32)
Expand All @@ -69,6 +86,13 @@ if(VTKPythonPackage_SUPERBUILD)
set(VTK_USE_X ON)
endif()


if(UNIX AND NOT APPLE)
list(APPEND ep_common_cmake_cache_args
-DOpenGL_GL_PREFERENCE:STRING=${OpenGL_GL_PREFERENCE})
endif()


#-----------------------------------------------------------------------------
include(ExternalProject)

Expand Down Expand Up @@ -218,6 +242,7 @@ if(VTKPythonPackage_SUPERBUILD)
-DVTK_Group_Qt:BOOL=OFF # XXX Enabled this later
-DVTK_RENDERING_BACKEND:STRING=OpenGL2
-DVTK_OPENGL_HAS_OSMESA:BOOL=${VTK_OPENGL_HAS_OSMESA}
-DVTK_OPENGL_HAS_EGL:BOOL=${VTK_OPENGL_HAS_EGL}
-DVTK_USE_X:BOOL=${VTK_USE_X}

# Module options
Expand Down