DuneAddPybind11Module ===================== Infrastructure for building Python extension modules with pybind11-style bindings. .. cmake:command:: dune_add_pybind11_module Add a Python extension module as a shared library target. .. code-block:: cmake dune_add_pybind11_module( NAME [SOURCES ...] [EXCLUDE_FROM_ALL] [COMPILE_DEFINITIONS ...] [CMAKE_GUARD ...] ) ``NAME`` Name of the Python extension module target. ``SOURCES`` Source files used to build the shared library. If omitted, ``.cc`` is used when that file exists in the current source directory. ``EXCLUDE_FROM_ALL`` Exclude the generated target from the default ``all`` target. ``COMPILE_DEFINITIONS`` Additional compile definitions passed to :dune:cmake-command:`target_compile_definitions`. ``CMAKE_GUARD`` Conditions evaluated before the module target is added. If one of the conditions evaluates to false, the target is skipped. The generated target links against ``Dune::Common`` and ``Python3::Module`` and is configured with :cmake:command:`dune_target_enable_all_packages()`. .. cmake:command:: dune_add_pybind11_submodule Add an object-library submodule and link it into an existing Python module. .. code-block:: cmake dune_add_pybind11_submodule( MODULE NAME SOURCES ... [EXCLUDE_FROM_ALL] [COMPILE_DEFINITIONS ...] [CMAKE_GUARD ...] ) ``MODULE`` Name of the previously created parent module target that receives the submodule object library. ``NAME`` Name of the object-library target providing the submodule sources. ``SOURCES`` Source files compiled into the object library. ``EXCLUDE_FROM_ALL`` Exclude the object-library target from the default ``all`` target. ``COMPILE_DEFINITIONS`` Additional compile definitions passed to :dune:cmake-command:`target_compile_definitions`. ``CMAKE_GUARD`` Conditions evaluated before the submodule target is added. If one of the conditions evaluates to false, the target is skipped. The generated object library links against ``Dune::Common``, is configured with :cmake:command:`dune_target_enable_all_packages()`, and is linked into the parent module target specified by ``MODULE``.