DuneAddPybind11Module¶
Infrastructure for building Python extension modules with pybind11-style bindings.
- dune_add_pybind11_module¶
Add a Python extension module as a shared library target.
dune_add_pybind11_module( NAME <module-name> [SOURCES <sources>...] [EXCLUDE_FROM_ALL] [COMPILE_DEFINITIONS <definitions>...] [CMAKE_GUARD <condition>...] )
NAMEName of the Python extension module target.
SOURCESSource files used to build the shared library. If omitted,
<NAME>.ccis used when that file exists in the current source directory.EXCLUDE_FROM_ALLExclude the generated target from the default
alltarget.COMPILE_DEFINITIONSAdditional compile definitions passed to
target_compile_definitions().CMAKE_GUARDConditions 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::CommonandPython3::Moduleand is configured withdune_target_enable_all_packages().
- dune_add_pybind11_submodule¶
Add an object-library submodule and link it into an existing Python module.
dune_add_pybind11_submodule( MODULE <parent-module> NAME <submodule-name> SOURCES <sources>... [EXCLUDE_FROM_ALL] [COMPILE_DEFINITIONS <definitions>...] [CMAKE_GUARD <condition>...] )
MODULEName of the previously created parent module target that receives the submodule object library.
NAMEName of the object-library target providing the submodule sources.
SOURCESSource files compiled into the object library.
EXCLUDE_FROM_ALLExclude the object-library target from the default
alltarget.COMPILE_DEFINITIONSAdditional compile definitions passed to
target_compile_definitions().CMAKE_GUARDConditions 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 withdune_target_enable_all_packages(), and is linked into the parent module target specified byMODULE.