This version of FindNetCDF.cmake uses the nc-config, nf-config and ncxx4-config to set the appropriate paths and flags for linking against the various NetCDF language components. This allows linking against static NetCDF installs, and linking on systems where each language component is installed to a separate prefix (as occurs in some HPC environment module based systems). The current FindNetCDF.cmake does not work for these scenarios.
In order to ensure the user links against the namespaced imported interface targets NetCDF::NetCDF_<LANG> targets, we have deprecated the NetCDF_LIBRARIES variable, but it should still work for packages already using that variable. It now points to the imported interface targets for each searched component.
This version of FindNetCDF.cmake uses the
nc-config
,nf-config
andncxx4-config
to set the appropriate paths and flags for linking against the various NetCDF language components. This allows linking against static NetCDF installs, and linking on systems where each language component is installed to a separate prefix (as occurs in some HPC environment module based systems). The current FindNetCDF.cmake does not work for these scenarios.In order to ensure the user links against the namespaced imported interface targets
NetCDF::NetCDF_<LANG>
targets, we have deprecated theNetCDF_LIBRARIES
variable, but it should still work for packages already using that variable. It now points to the imported interface targets for each searched component.