Skip to content
Snippets Groups Projects
Commit a4bf8de0 authored by Chris Green's avatar Chris Green Committed by Peter Scheibel
Browse files

gl2ps: add missing dependencies and doc variant. (#10886)

Makes building of documentation optional.
parent 4c68d2e1
No related branches found
No related tags found
No related merge requests found
...@@ -17,12 +17,14 @@ class Gl2ps(CMakePackage): ...@@ -17,12 +17,14 @@ class Gl2ps(CMakePackage):
variant('png', default=True, description='Enable PNG support') variant('png', default=True, description='Enable PNG support')
variant('zlib', default=True, description='Enable compression using ZLIB') variant('zlib', default=True, description='Enable compression using ZLIB')
variant('doc', default=False,
description='Generate documentation using pdflatex')
depends_on('cmake@2.4:', type='build') depends_on('cmake@2.4:', type='build')
# TODO: Add missing dependencies on OpenGL/Mesa and LaTeX
# X11 libraries: # X11 libraries:
depends_on('freeglut')
depends_on('gl')
depends_on('libice') depends_on('libice')
depends_on('libsm') depends_on('libsm')
depends_on('libxau') depends_on('libxau')
...@@ -40,12 +42,18 @@ class Gl2ps(CMakePackage): ...@@ -40,12 +42,18 @@ class Gl2ps(CMakePackage):
depends_on('libpng', when='+png') depends_on('libpng', when='+png')
depends_on('zlib', when='+zlib') depends_on('zlib', when='+zlib')
depends_on('texlive', type='build', when='+doc')
def variant_to_bool(self, variant): def variant_to_bool(self, variant):
return 'ON' if variant in self.spec else 'OFF' return 'ON' if variant in self.spec else 'OFF'
def cmake_args(self): def cmake_args(self):
return [ options = [
'-DENABLE_PNG={0}'.format(self.variant_to_bool('+png')), '-DENABLE_PNG={0}'.format(self.variant_to_bool('+png')),
'-DENABLE_ZLIB={0}'.format(self.variant_to_bool('+zlib')), '-DENABLE_ZLIB={0}'.format(self.variant_to_bool('+zlib')),
] ]
if '~doc' in self.spec:
# Make sure we don't look.
options.append('-DCMAKE_DISABLE_FIND_PACKAGE_LATEX:BOOL=ON')
return options
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