Skip to content
Snippets Groups Projects
Commit 67ef6df4 authored by Elizabeth Fischer's avatar Elizabeth Fischer Committed by Todd Gamblin
Browse files

Made optional CGAL dependencies optional. (#2006)

* Made optional CGAL dependencies optional.

* cgal: Added note explaining that the CORE library is not the same as core CGAL functionality.

* Bug fix and flake8

* flake8
parent b369be65
No related branches found
No related tags found
No related merge requests found
...@@ -44,13 +44,31 @@ class Cgal(Package): ...@@ -44,13 +44,31 @@ class Cgal(Package):
variant('debug', default=False, variant('debug', default=False,
description='Builds a debug version of the libraries') description='Builds a debug version of the libraries')
# ---- See "7 CGAL Libraries" at:
# http://doc.cgal.org/latest/Manual/installation.html
# The CORE library provides exact arithmetic for geometric computations.
# See: http://cs.nyu.edu/exact/core_pages/
# http://cs.nyu.edu/exact/core_pages/svn-core.html
variant('core', default=False,
description='Build the CORE library for algebraic numbers')
variant('imageio', default=False,
description='Build utilities to read/write image files')
variant('demos', default=False,
description='Build CGAL demos')
# Essential Third Party Libraries # Essential Third Party Libraries
depends_on('boost') depends_on('boost+thread+system')
depends_on('gmp') depends_on('gmp')
depends_on('mpfr') depends_on('mpfr')
# Required for CGAL_ImageIO
# depends_on('opengl', when='+imageio') # not yet in Spack
depends_on('zlib') depends_on('zlib')
# depends_on('opengl')
depends_on('qt@5:') # Optional to build CGAL_Qt5 (demos)
# depends_on('opengl', when='+demos') # not yet in Spack
depends_on('qt@5:', when='+demos')
# Optional Third Party Libraries # Optional Third Party Libraries
# depends_on('leda') # depends_on('leda')
...@@ -70,20 +88,19 @@ def install(self, spec, prefix): ...@@ -70,20 +88,19 @@ def install(self, spec, prefix):
# Installation instructions: # Installation instructions:
# http://doc.cgal.org/latest/Manual/installation.html # http://doc.cgal.org/latest/Manual/installation.html
options = [] options = std_cmake_args + [
options.extend(std_cmake_args) # CGAL supports only Release and Debug build type. Any
# other build type will raise an error at configure time
# CGAL supports only Release and Debug build type. Any other build type '-DCMAKE_BUILD_TYPE:STRING=%s' %
# will raise an error at configure time ('Debug' if '+debug' in spec else 'Release'),
if '+debug' in spec: '-DBUILD_SHARED_LIBS:BOOL=%s' %
options.append('-DCMAKE_BUILD_TYPE:STRING=Debug') ('ON' if '+shared' in spec else 'OFF'),
else: '-DWITH_CGAL_Core:BOOL=%s' %
options.append('-DCMAKE_BUILD_TYPE:STRING=Release') ('YES' if '+core' in spec else 'NO'),
'-DWITH_CGAL_ImageIO:BOOL=%s' %
if '+shared' in spec: ('YES' if '+imageio' in spec else 'NO'),
options.append('-DBUILD_SHARED_LIBS:BOOL=ON') '-DWITH_CGAL_Qt5:BOOL=%s' %
else: ('YES' if '+demos' in spec else 'NO')]
options.append('-DBUILD_SHARED_LIBS:BOOL=OFF')
with working_dir('spack-build', create=True): with working_dir('spack-build', create=True):
cmake('..', *options) cmake('..', *options)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment