Skip to content
Snippets Groups Projects
Commit 3b0311a1 authored by Dhanannjay Deo's avatar Dhanannjay Deo
Browse files

Add variant opengl2, which is ON by default

Needed for visit which depends on vtk@6.1.0~opengl2
parent 123996aa
Branches
Tags
No related merge requests found
......@@ -15,7 +15,15 @@ class Vtk(Package):
depends_on("qt")
# VTK7 defaults to OpenGL2 rendering backend
variant('opengl2', default=True, description='Build with OpenGL instead of OpenGL2 as rendering backend')
def install(self, spec, prefix):
def feature_to_bool(feature, on='ON', off='OFF'):
if feature in spec:
return on
return off
with working_dir('spack-build', create=True):
cmake_args = [
"..",
......@@ -43,6 +51,8 @@ def install(self, spec, prefix):
cmake_args.append("-DCMAKE_C_FLAGS=-DGLX_GLXEXT_LEGACY")
cmake_args.append("-DCMAKE_CXX_FLAGS=-DGLX_GLXEXT_LEGACY")
cmake_args.append('-DVTK_RENDERING_BACKEND:STRING=%s' % feature_to_bool('+opengl2', 'OpenGL2', 'OpenGL'))
cmake(*cmake_args)
make()
make("install")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment