From 17aa536cc4540d52bc8a23f6ca86cf435f59d2d3 Mon Sep 17 00:00:00 2001 From: Luca Bertagna Date: Wed, 11 Sep 2024 15:52:34 -0600 Subject: [PATCH] EAMxx: look for kokkos pkg only if it's not a target --- components/eamxx/src/physics/rrtmgp/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/eamxx/src/physics/rrtmgp/CMakeLists.txt b/components/eamxx/src/physics/rrtmgp/CMakeLists.txt index 1d3df9b4d2e..a8e47384552 100644 --- a/components/eamxx/src/physics/rrtmgp/CMakeLists.txt +++ b/components/eamxx/src/physics/rrtmgp/CMakeLists.txt @@ -127,7 +127,9 @@ yakl_process_target(rrtmgp) # NOTE: cannot use 'PUBLIC' in target_link_libraries, # since yakl_process_target already used it # with the "plain" signature -find_package(Kokkos REQUIRED) +if (NOT TARGET Kokkos::kokkos) + find_package(Kokkos REQUIRED) +endif () target_link_libraries(rrtmgp yakl Kokkos::kokkos) target_include_directories(rrtmgp PUBLIC ${SCREAM_BASE_DIR}/../../externals/YAKL