From be8fea690c3f9ab9ab40759a7542fa115b9d0422 Mon Sep 17 00:00:00 2001
From: Pradipta Samanta <samanta@dkrz.de>
Date: Mon, 24 Feb 2025 09:25:16 +0100
Subject: [PATCH] modified CMakeLists.txt of horizontal to enable compilation
 of C++ code that uses Kokkos

---
 src/horizontal/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/horizontal/CMakeLists.txt b/src/horizontal/CMakeLists.txt
index 7515842..6cebed9 100644
--- a/src/horizontal/CMakeLists.txt
+++ b/src/horizontal/CMakeLists.txt
@@ -52,11 +52,21 @@ target_include_directories(
     # Path to the Fortran modules:
     $<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:${Fortran_MODULE_DIRECTORY}>>
     $<INSTALL_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>>
+    # Path to the internal C/C++ headers (for testing): Requires CMake 3.15+ for
+    # multiple compile languages
+    # https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
+    $<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_SOURCE_DIR}>>
+  PRIVATE
+    # Path to config.h (for C and C++ only): Requires CMake 3.15+ for multiple
+    # compile languages
+    # https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
+    $<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_BINARY_DIR}>>
 )
 
 target_link_libraries(iconmath-horizontal PUBLIC fortran-support::fortran-support)
 target_link_libraries(iconmath-horizontal PUBLIC iconmath-support)
 target_link_libraries(iconmath-horizontal PUBLIC iconmath-interpolation)
+target_link_libraries(iconmath-interpolation PRIVATE Kokkos::kokkos)
 
 install(TARGETS iconmath-horizontal EXPORT "${PROJECT_NAME}-targets")
 
-- 
GitLab