Specify Python interpreter path or version when calling CMake
Summary
dune-common
uses findPythonInterp.cmake
to find a Python interpreter on the system and offers the function dune_python_require_version
to abort if the found interpreter doesn't match a specific version requirement. However, there is no way of specifying a certain Python interpreter if there are multiple ones installed on a system.
Is there way to set the Python interpreter explicitly?
Set Python interpreter through CMake variables
When building a virtual environment, it is necessary that the Python interpreter is specified for the dune-common
module. I'm thinking of CMake variables like
-
PYTHON_PATH
to the interpreter, or -
PYTHON_VERSION
specifying the exact version to be used
Use case
- Use Ubuntu 16.04 LTS (Python3.5 included)
- Have a DUNE module that uses the
dune-venv
and requires Python3.6 - Install Python3.6 separately
-
dune-common
always uses the v3.5 interpreter - Installation of my module fails