summaryrefslogtreecommitdiff
path: root/src/py
diff options
context:
space:
mode:
Diffstat (limited to 'src/py')
-rwxr-xr-xsrc/py/libcamera/gen-py-controls.py4
-rw-r--r--src/py/libcamera/meson.build18
2 files changed, 10 insertions, 12 deletions
diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py
index dfd7c179..cfcfd4d1 100755
--- a/src/py/libcamera/gen-py-controls.py
+++ b/src/py/libcamera/gen-py-controls.py
@@ -93,10 +93,10 @@ def main(argv):
help='Mode is either "controls" or "properties"')
parser.add_argument('--output', '-o', metavar='file', type=str,
help='Output file name. Defaults to standard output if not specified.')
+ parser.add_argument('--template', '-t', type=str, required=True,
+ help='Template file name.')
parser.add_argument('input', type=str,
help='Input file name.')
- parser.add_argument('template', type=str,
- help='Template file name.')
args = parser.parse_args(argv[1:])
if args.mode not in ['controls', 'properties']:
diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index f58c7198..1c3ea184 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -28,29 +28,27 @@ pycamera_sources = files([
# Generate controls
-gen_py_controls_input_files = files([
- '../../libcamera/control_ids.yaml',
- 'py_controls_generated.cpp.in',
-])
+gen_py_controls_input_files = files('../../libcamera/control_ids.yaml')
+gen_py_controls_template = files('py_controls_generated.cpp.in')
gen_py_controls = files('gen-py-controls.py')
pycamera_sources += custom_target('py_gen_controls',
input : gen_py_controls_input_files,
output : ['py_controls_generated.cpp'],
- command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@', '@INPUT@'])
+ command : [gen_py_controls, '--mode', 'controls', '-o', '@OUTPUT@',
+ '-t', gen_py_controls_template, '@INPUT@'])
# Generate properties
-gen_py_property_enums_input_files = files([
- '../../libcamera/property_ids.yaml',
- 'py_properties_generated.cpp.in',
-])
+gen_py_property_enums_input_files = files('../../libcamera/property_ids.yaml')
+gen_py_properties_template = files('py_properties_generated.cpp.in')
pycamera_sources += custom_target('py_gen_properties',
input : gen_py_property_enums_input_files,
output : ['py_properties_generated.cpp'],
- command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@', '@INPUT@'])
+ command : [gen_py_controls, '--mode', 'properties', '-o', '@OUTPUT@',
+ '-t', gen_py_properties_template, '@INPUT@'])
# Generate formats