File: template_main.j2

package info (click to toggle)
python-opencascade-pywrap 0.0~git20250714210719.b608b60-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 12,992 kB
  • sloc: python: 1,622; pascal: 32; makefile: 13; sh: 1
file content (41 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// pybind 11 related includes
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

// user-defined pre
{% if include_pre %}
#include "{{ include_pre }}"
{% endif %}

// forward declaration of the register_* functions

{% for mod in module_names %}
void register_{{mod}}_enums(py::module&);
{% endfor %}

{% for mod in module_names %}
void register_{{mod}}(py::module&);
{% endfor %}

// main module definiiton
PYBIND11_MODULE({{name}}, m) {

// register submodules

{% for mod in sorted_modules %}
    register_{{mod}}_enums(m);
{% endfor %}

{% for mod in sorted_modules %}
    register_{{mod}}(m);
{% endfor %}

// Add attributes if present

{% for k,v in settings['Attributes'].items() %}
    m.attr("{{k}}") = py::cast("{{v}}");
{% endfor %}

}