Skip to content

Commit f98c831

Browse files
committed
FindNetCDF: fix typos, add version range handling
1 parent 2799c4f commit f98c831

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cmake/Modules/FindNetCDF.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,20 @@ if(PkgConfig_FOUND AND NOT NetCDF_Fortran_LIBRARY)
9898
endif()
9999

100100
find_path(NetCDF_Fortran_INCLUDE_DIR
101-
names netcdf.mod
102-
HINTS ${pc_ncf_INCLUDE_DIRS}
101+
NAMES netcdf.mod
102+
HINTS ${NetCDF_C_INCLUDE_DIR} ${pc_ncf_INCLUDE_DIRS}
103103
DOC "NetCDF Fortran Include"
104104
)
105105

106106
if(NOT NetCDF_Fortran_INCLUDE_DIR)
107107
return()
108108
endif()
109109

110+
cmake_path(GET NetCDF_C_LIBRARY PARENT_PATH NetCDF_LIBDIR)
111+
110112
find_library(NetCDF_Fortran_LIBRARY
111113
NAMES netcdff
112-
HINTS ${pc_ncf_LIBRARY_DIRS} ${pc_ncf_LIBDIR}
114+
HINTS ${NetCDF_LIBDIR} ${pc_ncf_LIBRARY_DIRS} ${pc_ncf_LIBDIR}
113115
DOC "NetCDF Fortran library"
114116
)
115117

@@ -166,6 +168,7 @@ mark_as_advanced(NetCDF_C_INCLUDE_DIR NetCDF_Fortran_INCLUDE_DIR NetCDF_C_LIBRAR
166168
include(FindPackageHandleStandardArgs)
167169
find_package_handle_standard_args(NetCDF
168170
REQUIRED_VARS _ncdf_req
171+
VERSION_VAR NetCDF_VERSION
169172
HANDLE_COMPONENTS
170173
HANDLE_VERSION_RANGE
171174
)

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"@type": "SoftwareSourceCode",
44
"codeRepository": "https://github.com/geospace-code/nc4fortran",
55
"contIntegration": "https://github.com/geospace-code/nc4fortran/actions",
6-
"dateModified": "2021-12-22",
6+
"dateModified": "2022-01-26",
77
"downloadUrl": "https://github.com/geospace-code/nc4fortran/releases",
88
"issueTracker": "https://github.com/geospace-code/nc4fortran/issues",
99
"name": "nc4fortran",
10-
"version": "1.5.0",
10+
"version": "1.5.1",
1111
"identifier": "10.5281/zenodo.3757221",
1212
"description": "Lightweight object-oriented NetCDF4 Fortran interface",
1313
"applicationCategory": "file I/O",

0 commit comments

Comments
 (0)