openPMD-api: shared variant (#10847)

Add a variant to control shared/static builds (one at a time) and
make shared the default.
This commit is contained in:
Axel Huebl 2019-03-13 01:58:44 +01:00 committed by Adam J. Stewart
parent 46fb6ed5b6
commit fd6d3f6b8c

View File

@ -16,6 +16,8 @@ class OpenpmdApi(CMakePackage):
version('develop', branch='dev')
variant('shared', default=True,
description='Build a shared version of the library')
variant('mpi', default=True,
description='Enable parallel I/O')
variant('hdf5', default=True,
@ -55,6 +57,8 @@ def cmake_args(self):
spec = self.spec
args = [
'-DBUILD_SHARED_LIBS:BOOL={0}'.format(
'ON' if '+shared' in spec else 'OFF'),
# variants
'-DopenPMD_USE_MPI:BOOL={0}'.format(
'ON' if '+mpi' in spec else 'OFF'),