opencvrtcwxs.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 data = [
18  ("bin", "*.dll *.exe rtc.conf")
19 ]
20 
21 import os
22 base_dir = os.getenv("OPENCV_RTC_ROOT")
23 base_dir = base_dir.replace("\"", "")
24 
25 if base_dir == None:
26  base_dir="C:\distribution\ImageProcessing\opencv"
27 else:
28  base_dir += "\\"
29 
30 def path_to_dir_id(path, prefix):
31  # path = "bin/x86_win32" prefix = "omni"
32  # output = "omni_bin_x86_win32"
33  # "." -> "_"
34  output = prefix + "_" + "_".join(path.split("/"))
35  return output.replace(".", "_")
36 
37 
38 def path_to_comp_id(path, prefix):
39  # path = "bin/x86_win32" prefix = "omni"
40  # output = "OmniBinX86_win32"
41  # "." -> "_"
42  output = prefix
43  for c in path.split("/"):
44  output += c.capitalize()
45  return output.replace(".", "_")
46 
47 import makewxs
48 
49 for (path, files) in data:
50  # wxs component name
51  comp_name = path_to_comp_id(path, "OpenCVRTC")
52  # wxs directory name
53  dir_name = path_to_dir_id(path, "OpenCVRTC")
54 
55  path = path.replace("/", "\\")
56 
57  # full path to target directory
58  full_path = base_dir + "\\\\" + path
59 
60  import glob
61  flist = []
62  for f in files.split(" "):
63  flist += glob.glob(full_path + "\\" + f)
64 
65  cmd = ["flist",
66  "-c", comp_name,
67  "-o", dir_name + ".yaml",
68  "-p", base_dir + path]
69  cmd += flist
70 
71  makewxs.main(cmd)
72 
73 
74 cmd = ["wxs",
75  "-o", "OpenCV-RTC_inc.wxs",
76  "-i", "OpenCV-RTC_inc.wxs.in"]
77 cmd += glob.glob("*.yaml")
78 makewxs.main(cmd)
def path_to_dir_id(path, prefix)
Definition: opencvrtcwxs.py:30
def path_to_comp_id(path, prefix)
Definition: opencvrtcwxs.py:38


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Jun 10 2019 14:07:53