diff --git a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake index f76fe661cb2c12892116da5d73aaa00a0efc1c1a..8790c9d977e28a339fe041731024bd597a9d6d82 100644 --- a/src/pystencilssfg/cmake/FindPystencilsSfg.cmake +++ b/src/pystencilssfg/cmake/FindPystencilsSfg.cmake @@ -3,6 +3,9 @@ Find-Module for pystencils-sfg. # Setting the Python interpreter +If the cache CODEGEN_PRIVATE_VENV is true, it will try to create to a own python venv and install the requirements from `CODEGEN_VENV_REQUIREMENTS`. +If this file does not exists it will download pystencilssfg and pystencils from `PystencilsSfg_URL` and `Pystencils_URL` + If the cache entry PystencilsSfg_PYTHON_INTERPRETER is set, e.g. via the commandline (`-DPystencilsSfg_PYTHON_INTERPRETER=<...>`), its value be taken as the Python interpreter used to find and run pystencils-sfg. @@ -14,11 +17,15 @@ If none of these is set, a Python interpreter will be selected using the `FindPy #]] -set( - CODEGEN_PRIVATE_VENV ON +set(CODEGEN_PRIVATE_VENV ON CACHE BOOL "Create a private virtual Python environment inside the build tree for code generation" ) +if (DEFINED CACHE{PystencilsSfg_PYTHON_INTERPRETER}) + set( CODEGEN_PRIVATE_VENV OFF) +elseif(DEFINED PystencilsSfg_PYTHON_PATH) + set( CODEGEN_PRIVATE_VENV OFF) +endif() if(NOT DEFINED CACHE{PystencilsSfg_PYTHON_INTERPRETER}) # The Python interpreter cache variable is not set externally, so...