Skip to content

Commit

Permalink
Use ip@5: if available instead of sp if available
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed Oct 7, 2024
1 parent 51ad51f commit eca1021
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/../../CMakeModule

find_package(NetCDF REQUIRED COMPONENTS C Fortran)
find_package(bacio REQUIRED)
find_package(sp REQUIRED)
# Use ip@5 or later if available, fall back to sp
find_package(ip 5)
if(NOT ip_FOUND)
find_package(sp REQUIRED)
endif()
find_package(w3emc REQUIRED)
find_package(MPI REQUIRED)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
Expand Down Expand Up @@ -302,7 +306,11 @@ if(OPENMP)
endif()
TARGET_LINK_LIBRARIES(scm NetCDF::NetCDF_Fortran)
TARGET_LINK_LIBRARIES(scm bacio::bacio_4)
TARGET_LINK_LIBRARIES(scm sp::sp_d)
if(ip_FOUND)
target_link_libraries(scm ip::ip_d)
else()
target_link_libraries(scm sp::sp_d)
endif()
TARGET_LINK_LIBRARIES(scm w3emc::w3emc_d)
TARGET_LINK_LIBRARIES(scm ccpp_framework)
TARGET_LINK_LIBRARIES(scm ccpp_physics)
Expand Down

0 comments on commit eca1021

Please sign in to comment.