Skip to content

Commit

Permalink
#263: Use the correct name for linking against Kokkos Kernels dependi…
Browse files Browse the repository at this point in the history
…ng on the circumstances
  • Loading branch information
PhilMiller authored and lifflander committed Jul 13, 2023
1 parent 1c0a93a commit 405cc99
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ if (${kokkos_DIR_FOUND})
if (KokkosKernels_DIR_FOUND)
message(STATUS "Checkpoint: Kokkos kernels enabled")
set(KERNELS 1)
target_link_libraries(${CHECKPOINT_LIBRARY} PUBLIC Kokkos::kokkoskernels)
# Kokkos Kernels historically installed its EXPORT targets in the Kokkos:: namespace, and several
# downstream packages import it as such, so it's not readily changed.
# Meanwhile, Trilinos installs it under the more consistent KokkosKernels:: namespace.
# Account for both possiblie routes of acquiring Kokkos Kernels here
if(TARGET KokkosKernels::kokkoskernels)
target_link_libraries(${CHECKPOINT_LIBRARY} PUBLIC KokkosKernels::kokkoskernels)
else()
target_link_libraries(${CHECKPOINT_LIBRARY} PUBLIC Kokkos::kokkoskernels)
endif()
else()
message(STATUS "Checkpoint: Kokkos kernels disabled")
set(KERNELS 0)
Expand Down

0 comments on commit 405cc99

Please sign in to comment.