We ran into a problem, where this script linked a wrong HDF5 version and the executable, that was linked against NetCDF::NetCDF_Fortran, crashed with a HDF5 version warning.
There were two HDF5 versions present on our system, which is now resolved.
But: Other scripts like https://github.com/geospace-code/nc4fortran/blob/main/cmake/Modules/FindNetCDF.cmake were able to provide a correctly linkable netcdf-fortran library.
I don't know at which point stuff went wrong, but still wanted to draw attention to this issue.
Cheers,
Sebastian