Unidata / netcdf-cxx4

Official GitHub repository for netCDF-C++ libraries and utilities.
Other
124 stars 49 forks source link

Use nc-config in configure to check capabilities #39

Closed ZedThree closed 7 years ago

ZedThree commented 8 years ago

Currently, configure searches for the NetCDF header and library, and checks for various functions in order to determine what capabilities it has. However, nc-config, which comes with most (all?) NetCDF distributions already has this information.

This PR adds the flags --with-nc-config/--without-nc-config to ./configure. If --without-nc-config is specified, then configure uses the current method to determine functionality. Otherwise, it will use nc-config from either $PATH, or the path supplied to --with-nc-config=<path>. This always different NetCDF-C installations to be used, and not just the default system one.

Unfortunately, I don't know enough CMake to add it to that build system as well, but presumably this could be done.

Also, although it doesn't appear that you actually link against NetCDF-C, nc-config could also supply LDFLAGS, LIBS, CPPFLAGS if needed.