Skip to content

Commit

Permalink
bugfix of FindESMF from ufs-weather model (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerorahul authored Sep 19, 2020
1 parent 3eaddb8 commit 8aaef34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/FindESMF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else()
set(ESMF_FOUND FALSE CACHE BOOL "ESMF mk file NOT found" FORCE)
# Best to warn users that without the mk file there is no way to find ESMF
if (NOT DEFINED ESMFMKFILE)
message(WARNING "ESMFMKFILE not defined. This is the path to esmf.mk file. \
message(FATAL_ERROR "ESMFMKFILE not defined. This is the path to esmf.mk file. \
Without this filepath, ESMF_FOUND will always be FALSE.")
endif ()
endif()
Expand Down Expand Up @@ -86,14 +86,14 @@ if (ESMF_FOUND)
message(STATUS "Static ESMF library not found, searching for dynamic library instead")
find_library(esmf_lib NAMES esmf_fullylinked PATHS ${ESMF_LIBSDIR})
if(esmf_lib MATCHES "esmf_lib-NOTFOUND")
message(WARNING "Neither the dynamic nor the static ESMF library was found")
message(FATAL_ERROR "Neither the dynamic nor the static ESMF library was found")
else()
message(STATUS "Found ESMF library: ${esmf_lib}")
endif()
set(ESMF_INTERFACE_LINK_LIBRARIES "")
else()
# When linking the static library, also need the ESMF linker flags; strip any leading/trailing whitespaces
string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES)
string(STRIP "${ESMF_F90ESMFLINKRPATHS} ${ESMF_F90ESMFLINKPATHS} ${ESMF_F90LINKPATHS} ${ESMF_F90LINKLIBS} ${ESMF_F90LINKOPTS}" ESMF_INTERFACE_LINK_LIBRARIES)
message(STATUS "Found ESMF library: ${esmf_lib}")
endif()

Expand Down

0 comments on commit 8aaef34

Please sign in to comment.