netcdf-cxx package: Add optional netCDF4 support (#10899)

This commit is contained in:
Dustin Lagoy 2019-03-25 18:22:15 -07:00 committed by Peter Scheibel
parent 57523c3f0b
commit 14acfb65c4

View file

@ -19,9 +19,20 @@ class NetcdfCxx(AutotoolsPackage):
depends_on('netcdf')
variant(
'netcdf4', default=True, description='Compile with netCDF4 support')
@property
def libs(self):
shared = True
return find_libraries(
'libnetcdf_c++', root=self.prefix, shared=shared, recursive=True
)
def configure_args(self):
args = []
if '+netcdf4' in self.spec:
# There is no clear way to set this via configure, so set the flag
# explicitly
args.append('CPPFLAGS=-DUSE_NETCDF4')
return args