backup search of NetCDF using PkgConfig
@@ -256,7 +256,11 @@ INCLUDE(CheckCSourceCompiles)
INCLUDE(FindNetCDF)
message("Fortran Library build is ${PIO_ENABLE_FORTRAN}")
if (PIO_ENABLE_FORTRAN)
- find_package (NetCDF REQUIRED COMPONENTS C Fortran)
+ find_package (NetCDF COMPONENTS C Fortran)
+ if (NOT NetCDF_Fortran_FOUND)
+ include(FindPkgConfig)
+ pkg_check_modules(NetCDF_Fortran REQUIRED IMPORTED_TARGET "netcdf-fortran")
+ endif()
if (WITH_PNETCDF)
find_package (PnetCDF COMPONENTS C Fortran)
endif()
