Skip to content

Commit 650021d

Browse files
committed
Fix name of netcdf config file for Fortran component
1 parent 0e2cf7a commit 650021d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cmake/FindNetCDF.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,14 @@ foreach (NCDFcomp IN LISTS NetCDF_FIND_VALID_COMPONENTS)
146146
CHECK_FUNCTION_EXISTS(nc__enddef NetCDF_C_NC__ENDDEF_EXISTS)
147147
endif ()
148148

149-
string(TOLOWER "${NCDFcomp}" ncdfcomp)
149+
if (NCDFcomp STREQUAL "C")
150+
set (config_exe_name nc-config)
151+
else()
152+
set (config_exe_name nf-config)
153+
endif()
150154
find_program(NetCDF_${NCDFcomp}_CONFIG_EXE
151-
NAMES n${ncdfcomp}-config
155+
NAMES ${config_exe_name}
152156
HINTS ${NetCDF_${NCDFcomp}_INCLUDE_DIR}/../bin)
153-
154157
if (NetCDF_${NCDFcomp}_CONFIG_EXE)
155158
message(STATUS "NetCDF_${NCDFcomp}_CONFIG_EXE = ${NetCDF_${NCDFcomp}_CONFIG_EXE}")
156159
execute_process(COMMAND "${NetCDF_${NCDFcomp}_CONFIG_EXE}" "--has-nczarr"

0 commit comments

Comments
 (0)