netcdf-cxx package: Add optional netCDF4 support (#10899)
This commit is contained in:
parent
57523c3f0b
commit
14acfb65c4
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue