From a94d856c7af6c5e182881fc50f9b97eefbb3f70f Mon Sep 17 00:00:00 2001 From: David Minton Date: Mon, 21 Aug 2023 22:45:30 -0400 Subject: [PATCH] More improvements to the Windows build --- .gitignore | 1 + cmake/Modules/FindNETCDF.cmake | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 04b43e978..9c5ee861f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ dump* swiftest-* __pycache__* _cmake* +_dependencies #Documentation diff --git a/cmake/Modules/FindNETCDF.cmake b/cmake/Modules/FindNETCDF.cmake index 2eca345b8..d1987e8b1 100644 --- a/cmake/Modules/FindNETCDF.cmake +++ b/cmake/Modules/FindNETCDF.cmake @@ -67,6 +67,7 @@ MESSAGE(STATUS "NetCDF-Fortran include directory: ${NETCDF_INCLUDE_DIR}") IF (BUILD_SHARED_LIBS OR CMAKE_SYSTEM_NAME STREQUAL "Windows") SET(NETCDFF "netcdff") + SET(NETCDF "netcdf") ELSE () SET(NETCDFF "libnetcdff.a") SET(NETCDF "libnetcdf.a") @@ -133,6 +134,11 @@ ELSE () ELSE () MESSAGE(FATAL_ERROR "Cannot find nc-config") ENDIF () + ELSE () + FIND_PACKAGE(NETCDF CONFIG QUIET) + IF (NETCDF_FOUND) + set(NETCDF_LIBRARY "${netCDF_LIBRARIES}") + ENDIF() ENDIF() IF (DEFINED ENV{LIBS})