diff --git a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake index a347fa754f2bc0fb5ff94f85ee39d1ced44c08c3..20a3fd596d99cf2db18e346609b8060bf86d32bc 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 3913c704b791dbd6cb19fd1da1206fa80d59c888..f8fe8ddf332fe9c97a1c5c7a25309db8fde5884b 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}")