@@ -32,6 +32,7 @@ class OpenCVRecipe(NDKRecipe):
3232 'libopencv_dnn.so' ,
3333 'libopencv_imgcodecs.so' ,
3434 'libopencv_photo.so'
35+ # todo: add opencv_extras libraries
3536 ]
3637
3738 def get_lib_dir (self , arch ):
@@ -46,6 +47,16 @@ def get_recipe_env(self, arch):
4647 def build_arch (self , arch ):
4748 build_dir = join (self .get_build_dir (arch .arch ), 'build' )
4849 shprint (sh .mkdir , '-p' , build_dir )
50+
51+ opencv_extras = []
52+ if 'opencv_extras' in self .ctx .recipe_build_order :
53+ opencv_extras_dir = self .get_recipe (
54+ 'opencv_extras' , self .ctx ).get_build_dir (arch .arch )
55+ opencv_extras = [
56+ f'-DOPENCV_EXTRA_MODULES_PATH={ opencv_extras_dir } /modules' ,
57+ '-DBUILD_opencv_legacy=OFF' ,
58+ ]
59+
4960 with current_directory (build_dir ):
5061 env = self .get_recipe_env (arch )
5162
@@ -120,6 +131,8 @@ def build_arch(self, arch):
120131 '-DPYTHON{major}_PACKAGES_PATH={site_packages}' .format (
121132 major = python_major , site_packages = python_site_packages ),
122133
134+ * opencv_extras ,
135+
123136 self .get_build_dir (arch .arch ),
124137 _env = env )
125138 shprint (sh .make , '-j' + str (cpu_count ()), 'opencv_python' + python_major )
0 commit comments