DuneProvidePybind11

Helpers for providing pybind11 to DUNE Python extension targets.

DUNE_USE_SYSTEM_PYBIND11

Use an external pybind11 installation instead of the vendored headers shipped with dune-common.

When this option is enabled, dune_provide_pybind11() first tries find_package(pybind11 CONFIG). If that fails, it downloads pybind11 and creates an imported compatibility target for it.

dune_provide_pybind11

Ensure that the given target can use pybind11.

Depending on DUNE_USE_SYSTEM_PYBIND11, this either links the target against an external or downloaded pybind11::module target, or adds the vendored include directory from dune-common directly.

dune_provide_pybind11(<target>)
target

Existing target that should be configured for pybind11 usage.