Properly find and activate python
The cmake function add_dune_pythonlibs_flags
did set the HAVE_PYTHON
flag unconditionally. Because it was not found in my setup this lead to compiler errors like missing include <Python.h>
. With this MR, these flags are only added if Python is actually found somehow. Also it adds the actual call to find_package(Python3...)
that was missing before. Note that the Python3_FOUND
is only set if python was found in the current scope. Since you cannot rely on the way other module might have searched for python and might have set this variable, it is better to just search for Python again.