Skip to content

Commit

Permalink
Special case for finding FindESMF.cmake on WCOSS2 in non-standard loc…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
DusanJovic-NOAA committed Aug 23, 2024
1 parent c994cb0 commit 8157915
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU" AND CMAKE_Fortran_COMPILER_VERSION V
message(FATAL_ERROR "GNU Compiler >= 9 is required")
endif()

set(CMAKE_Platform $ENV{CMAKE_Platform})

if(CMAKE_Platform STREQUAL "wcoss2")
list(APPEND CMAKE_MODULE_PATH $ENV{ESMF_ROOT}/include/ESMX/Driver/cmake)
endif()

list(APPEND CMAKE_MODULE_PATH $ENV{ESMF_ROOT}/cmake)
list(APPEND CMAKE_MODULE_PATH $ENV{esmf_ROOT}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/Modules)
Expand Down Expand Up @@ -76,7 +82,6 @@ set(PDLIB OFF CACHE BOOL "Enable Domain Decomposition in WW3 via PDLIB
set(CDEPS_INLINE OFF CACHE BOOL "Enable CDEPS inline capability")
set(HYDRO OFF CACHE BOOL "Enable hydrostatic set")

set(CMAKE_Platform $ENV{CMAKE_Platform})
if(CMAKE_Platform)
message("")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/configure_${CMAKE_Platform}.cmake)
Expand Down Expand Up @@ -149,6 +154,12 @@ endif()

find_package(NetCDF 4.7.4 REQUIRED C Fortran)
find_package(ESMF 8.6.0 MODULE REQUIRED)
if (NOT TARGET ESMF::ESMF) # This is needed for ESMF < 8.6.1
add_library(ESMF::ESMF ALIAS ESMF)
if (NOT TARGET esmf)
add_library(esmf ALIAS ESMF)
endif()
endif ()
if(FMS)
find_package(FMS 2022.04 REQUIRED COMPONENTS R4 R8)
if(APP MATCHES "^(HAFSW)$")
Expand Down

0 comments on commit 8157915

Please sign in to comment.