FIND_PACKAGE(Kokkos
HINTS ${KOKKOS_DIR} ${Kokkos_DIR} $ENV{Kokkos_DIR}
)
-
+
IF(Kokkos_FOUND)
# We are only interested in Kokkos if it is not part of Trilinos
- IF(TARGET Kokkos::kokkos)
+ IF(TARGET Kokkos::kokkos AND TARGET Kokkos::kokkoscore)
GET_PROPERTY(KOKKOS_INSTALL_INCLUDE_DIR TARGET Kokkos::kokkos PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
GET_PROPERTY(KOKKOS_EXTRA_LD_FLAGS_FULL TARGET Kokkos::kokkoscore PROPERTY INTERFACE_LINK_OPTIONS)
STRING(REGEX REPLACE "\\$<\\$<LINK_LANGUAGE:CXX>:([^>]*)>" "\\1" KOKKOS_EXTRA_LD_FLAGS "${KOKKOS_EXTRA_LD_FLAGS_FULL}")
IF(KOKKOS_COMPILE_FLAGS)
ADD_FLAGS(DEAL_II_CXX_FLAGS ${KOKKOS_COMPILE_FLAGS})
ENDIF()
-
+
DEAL_II_FIND_LIBRARY(KOKKOS_CORE_LIBRARY
NAMES kokkoscore
HINTS ${KOKKOS_DIR}/lib ${Kokkos_DIR}/lib $ENV{Kokkos_DIR}/lib
PATH_SUFFIXES
lib${LIB_SUFFIX} lib64 lib
)
-
+
DEAL_II_FIND_LIBRARY(KOKKOS_CONTAINERS_LIBRARY
NAMES kokkoscontainers
HINTS ${KOKKOS_DIR}/lib ${Kokkos_DIR}/lib $ENV{Kokkos_DIR}/lib
SET(Kokkos_FOUND FALSE)
ENDIF()
ENDIF()
-
+
DEAL_II_PACKAGE_HANDLE(KOKKOS
LIBRARIES REQUIRED KOKKOS_CORE_LIBRARY KOKKOS_CONTAINERS_LIBRARY
INCLUDE_DIRS REQUIRED KOKKOS_INSTALL_INCLUDE_DIR
LINKER_FLAGS OPTIONAL KOKKOS_EXTRA_LD_FLAGS
CLEAR KOKKOS_DIR KOKKOS_CORE_LIBRARY KOKKOS_CONTAINERS_LIBRARY
)
-
ENDIF()