From 9d3e553da6df38f51da69544905dd6391b59cac3 Mon Sep 17 00:00:00 2001
From: Frederik Hennig <frederik.hennig@fau.de>
Date: Wed, 15 Jan 2025 16:34:38 +0100
Subject: [PATCH] update modules

---
 src/pystencilssfg/cmake/FindPystencilsSfg.cmake     | 1 +
 src/pystencilssfg/cmake/modules/PystencilsSfg.cmake | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
index a347fa7..20a3fd5 100644
--- a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
+++ b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake
@@ -47,6 +47,7 @@ endif()
 
 if(${PystencilsSfg_FOUND})
     message( STATUS "Found pystencils Source File Generator (Version ${PystencilsSfg_VERSION})")
+    message( STATUS "Using Python interpreter ${PystencilsSfg_PYTHON_INTERPRETER} for SFG generator scripts.")
     
     execute_process(COMMAND ${PystencilsSfg_PYTHON_INTERPRETER} -m pystencilssfg cmake modulepath --no-newline
                     OUTPUT_VARIABLE _PystencilsSfg_CMAKE_MODULE_PATH)
diff --git a/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake b/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
index 3913c70..f8fe8dd 100644
--- a/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
+++ b/src/pystencilssfg/cmake/modules/PystencilsSfg.cmake
@@ -10,7 +10,9 @@ set(PystencilsSfg_GENERATED_SOURCES_DIR "${CMAKE_BINARY_DIR}/sfg_sources" CACHE
 mark_as_advanced(PystencilsSfg_GENERATED_SOURCES_DIR)
 
 #   This cache variable definition is a duplicate of the one in FindPystencilsSfg.cmake
-set(PystencilsSfg_PYTHON_INTERPRETER ${Python_EXECUTABLE} CACHE PATH "Path to the Python executable used to run pystencils-sfg")
+if(NOT DEFINED CACHE{PystencilsSfg_PYTHON_INTERPRETER})
+    set(PystencilsSfg_PYTHON_INTERPRETER ${Python_EXECUTABLE} CACHE PATH "Path to the Python executable used to run pystencils-sfg")
+endif()
 
 file(MAKE_DIRECTORY "${PystencilsSfg_GENERATED_SOURCES_DIR}")
 
-- 
GitLab