opencvwxs.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #
3 # @brief WiX wxs file generator for omniORB
4 # @date $Date$
5 # @author Norkai Ando <n-ando@aist.go.jp>
6 #
7 # Copyright (C) 2010
8 # Noriaki Ando
9 # Intelligent Systems Research Institute,
10 # National Institute of
11 # Advanced Industrial Science and Technology (AIST), Japan
12 # All rights reserved.
13 #
14 # $Id$
15 #
16 
17 OpenCV_files = "README OpenCVConfig.cmake"
18 
19 data = [
20  ("", OpenCV_files),
21  ("bin", "*.dll"),
22  ("include/opencv", "*.h *.hpp"),
23  ("lib", "*.lib"),
24  ("doc", "license.txt opencv.pdf")
25 ]
26 
27 import os
28 base_dir = os.getenv("OPENCV_ROOT")
29 base_dir = base_dir.replace("\"", "")
30 
31 if base_dir == None:
32  base_dir="C:\\OpenCV2.1"
33 else:
34  base_dir += "\\"
35 
36 def path_to_dir_id(path, prefix):
37  # path = "bin/x86_win32" prefix = "omni"
38  # output = "omni_bin_x86_win32"
39  # "." -> "_"
40  output = prefix + "_" + "_".join(path.split("/"))
41  return output.replace(".", "_")
42 
43 
44 def path_to_comp_id(path, prefix):
45  # path = "bin/x86_win32" prefix = "omni"
46  # output = "OmniBinX86_win32"
47  # "." -> "_"
48  output = prefix
49  for c in path.split("/"):
50  output += c.capitalize()
51  return output.replace(".", "_")
52 
53 import makewxs
54 
55 for (path, files) in data:
56  # wxs component name
57  comp_name = path_to_comp_id(path, "OpenCV")
58  # wxs directory name
59  dir_name = path_to_dir_id(path, "OpenCV")
60 
61  path = path.replace("/", "\\")
62 
63  # full path to target directory
64  full_path = base_dir + "\\\\" + path
65 
66  import glob
67  flist = []
68  for f in files.split(" "):
69  flist += glob.glob(full_path + "\\" + f)
70 
71  cmd = ["flist",
72  "-c", comp_name,
73  "-o", dir_name + ".yaml",
74  "-p", base_dir + path]
75  cmd += flist
76 
77  makewxs.main(cmd)
78 
79 import re
80 if None != re.search('2\.2',base_dir):
81  cmd = ["wxs",
82  "-o", "OpenCV_inc.wxs",
83  "-i", "OpenCV22_inc.wxs.in"]
84 else:
85  cmd = ["wxs",
86  "-o", "OpenCV_inc.wxs",
87  "-i", "OpenCV_inc.wxs.in"]
88 
89 cmd += glob.glob("*.yaml")
90 makewxs.main(cmd)
def path_to_comp_id(path, prefix)
Definition: opencvwxs.py:44
def path_to_dir_id(path, prefix)
Definition: opencvwxs.py:36


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Jun 6 2019 19:25:59