diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build index 596a203ca..0b38b1248 100644 --- a/src/py/libcamera/meson.build +++ b/src/py/libcamera/meson.build @@ -1,21 +1,5 @@ # SPDX-License-Identifier: CC0-1.0 -py3_dep = dependency('python3', required : get_option('pycamera')) - -if not py3_dep.found() - pycamera_enabled = false - subdir_done() -endif - -pybind11_dep = dependency('pybind11', required : get_option('pycamera')) - -if not pybind11_dep.found() - pycamera_enabled = false - subdir_done() -endif - -pycamera_enabled = true - pycamera_sources = files([ 'py_camera_manager.cpp', 'py_color_space.cpp', diff --git a/src/py/meson.build b/src/py/meson.build index a4586b4ae..922806971 100644 --- a/src/py/meson.build +++ b/src/py/meson.build @@ -1,3 +1,15 @@ # SPDX-License-Identifier: CC0-1.0 +py3_dep = dependency('python3', required : get_option('pycamera')) +pybind11_dep = dependency('pybind11', required : get_option('pycamera')) + +pycamera_enabled = py3_dep.found() and pybind11_dep.found() +if not pycamera_enabled + subdir_done() +endif + subdir('libcamera') + +pycamera_devenv = environment() +pycamera_devenv.prepend('PYTHONPATH', meson.current_build_dir()) +meson.add_devenv(pycamera_devenv)