1#!/usr/bin/python
2
3# This file is part of OpenCV project.
4# It is subject to the license terms in the LICENSE file found in the top-level directory
5# of this distribution and at http://opencv.org/license.html
6# Copyright (C) 2020 by Archit Rungta
7
8import sys
9import subprocess
10import os
11
12mod_path = sys.argv[1]
13
14
15hdr_list = [
16mod_path+"/core/include/opencv2/core.hpp",
17mod_path+"/core/include/opencv2/core/base.hpp",
18mod_path+"/core/include/opencv2/core/bindings_utils.hpp",
19mod_path+"/core/include/opencv2/core/optim.hpp",
20mod_path+"/core/include/opencv2/core/persistence.hpp",
21mod_path+"/core/include/opencv2/core/types.hpp",
22mod_path+"/core/include/opencv2/core/utility.hpp"]
23
24for module in sys.argv[2:]:
25    if module=='opencv_imgproc':
26        hdr_list.append(mod_path+"/imgproc/include/opencv2/imgproc.hpp")
27    elif module =='opencv_dnn':
28        hdr_list.append(mod_path+"/dnn/include/opencv2/dnn/dnn.hpp")
29    elif module == 'opencv_imgcodecs':
30        hdr_list.append(mod_path+"/imgcodecs/include/opencv2/imgcodecs.hpp")
31    elif module =='opencv_videoio':
32        hdr_list.append(mod_path+"/videoio/include/opencv2/videoio.hpp")
33    elif module =='opencv_highgui':
34        hdr_list.append(mod_path+"/highgui/include/opencv2/highgui.hpp")
35    elif module =='opencv_calib3d':
36        hdr_list.append(mod_path+"/calib3d/include/opencv2/calib3d.hpp")
37
38if not os.path.exists('autogen_cpp'):
39    os.makedirs('autogen_cpp')
40    os.makedirs('autogen_jl')
41
42subprocess.call([sys.executable, 'gen3_cpp.py', str(';'.join(hdr_list))])
43subprocess.call([sys.executable, 'gen3_julia_cxx.py', str(';'.join(hdr_list))])
44subprocess.call([sys.executable, 'gen3_julia.py', str(';'.join(hdr_list))])
45