From 6b8a1110b116aca2015c56c716c5aeb834bb11b7 Mon Sep 17 00:00:00 2001 From: Luca Bertagna Date: Tue, 6 Feb 2024 17:23:21 -0700 Subject: [PATCH] Repeat ENV sub-option for all env vars in find_program ENV only applies to *the next* entry, not to all the entries in the HINTS list --- cmake/FindNetCDF.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake index bfd5391..c55cc28 100644 --- a/cmake/FindNetCDF.cmake +++ b/cmake/FindNetCDF.cmake @@ -1,13 +1,13 @@ # First try to locate nf-config. find_program(NetCDF_Fortran_CONFIG_EXECUTABLE NAMES nf-config - HINTS ENV NetCDF_ROOT NetCDF_Fortran_ROOT + HINTS ENV NetCDF_ROOT ENV NetCDF_Fortran_ROOT PATH_SUFFIXES bin Bin DOC "NetCDF config program. Used to detect NetCDF Fortran include directory and linker flags." ) mark_as_advanced(NetCDF_Fortran_CONFIG_EXECUTABLE) find_program(NetCDF_C_CONFIG_EXECUTABLE NAMES nc-config - HINTS ENV NetCDF_ROOT NetCDF_C_ROOT + HINTS ENV NetCDF_ROOT ENV NetCDF_C_ROOT PATH_SUFFIXES bin Bin DOC "NetCDF config program. Used to detect NetCDF C include directory and linker flags." ) mark_as_advanced(NetCDF_C_CONFIG_EXECUTABLE)