diff --git a/cmake-config b/cmake-config index e58ccc1957..50fc977846 100755 --- a/cmake-config +++ b/cmake-config @@ -248,8 +248,8 @@ fi MODERN=${MODERN:-NO} if [ "${MODERN}" == "YES" ] then -# MODERN_ARG="-D TPL_ENABLE_HDF5:BOOL=ON -D Netcdf_ALLOW_MODERN:BOOL=ON" - MODERN_ARG="-D Netcdf_ALLOW_MODERN:BOOL=ON" + MODERN_ARG="-D TPL_ENABLE_HDF5:BOOL=ON -D Netcdf_ALLOW_MODERN:BOOL=ON" +# MODERN_ARG="-D Netcdf_ALLOW_MODERN:BOOL=ON" else MODERN_ARG="" fi diff --git a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake index a46ecb762c..6917b4b014 100644 --- a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake +++ b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake @@ -43,11 +43,11 @@ endif() set(Netcdf_ALLOW_MODERN FALSE CACHE BOOL "Allow finding Netcdf as a modern CMake config file with exported targets (and only this way)") -if (Netcdf_ALLOW_MODERN AND HDF5_FOUND_MODERN_CONFIG_FILE) -#if (Netcdf_ALLOW_MODERN) +if ((Netcdf_ALLOW_MODERN AND HDF5_FOUND_MODERN_CONFIG_FILE) OR Netcdf_FORCE_MODERN) set(minimum_modern_netCDF_version 4.7.3) print_var(Netcdf_ALLOW_MODERN) + print_var(Netcdf_FORCE_MODERN) message("-- Using find_package(netCDF ${minimum_modern_netCDF_version} CONFIG) ...") find_package(netCDF ${minimum_modern_netCDF_version} CONFIG) if (netCDF_FOUND)