now accepts both kokkos on Home folder and automatic download

This commit is contained in:
HRN 2025-02-17 18:39:33 +03:30
parent ed4fe6f2f5
commit 354daab7c5
1 changed files with 17 additions and 11 deletions

View File

@ -23,8 +23,12 @@ endif()
cmake_policy(SET CMP0169 OLD)
include(FetchContent)
# Kokkos folder creation
set(Kokkos_Source_DIR $ENV{HOME}/Kokkos/kokkos)
if(NOT EXISTS "${Kokkos_Source_DIR}/CMakeLists.txt")
include(FetchContent)
FetchContent_Declare(
kokkos
GIT_REPOSITORY https://github.com/kokkos/kokkos.git
@ -38,6 +42,8 @@ if(NOT kokkos_POPULATED)
set(Kokkos_Source_DIR ${kokkos_SOURCE_DIR})
endif()
endif()
message(STATUS "Kokkos source directory is ${Kokkos_Source_DIR}")
add_subdirectory(${Kokkos_Source_DIR} ./kokkos)
#Kokkos_cmake_settings()