From eca10219581f3239b5c460447d7b745f61e22304 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 7 Oct 2024 07:55:37 -0600 Subject: [PATCH] Use ip@5: if available instead of sp if available --- scm/src/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scm/src/CMakeLists.txt b/scm/src/CMakeLists.txt index 4938e1b57..eb1871f75 100644 --- a/scm/src/CMakeLists.txt +++ b/scm/src/CMakeLists.txt @@ -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) @@ -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)