opencvrtcwxs.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 #
00003 # @brief WiX wxs file generator for omniORB
00004 # @date $Date$
00005 # @author Norkai Ando <n-ando@aist.go.jp>
00006 #
00007 # Copyright (C) 2010
00008 #     Noriaki Ando
00009 #     Intelligent Systems Research Institute,
00010 #     National Institute of
00011 #         Advanced Industrial Science and Technology (AIST), Japan
00012 #     All rights reserved.
00013 #
00014 # $Id$
00015 #
00016 
00017 data = [
00018     ("bin",             "*.dll *.exe rtc.conf")
00019 ]
00020 
00021 import os
00022 base_dir = os.getenv("OPENCV_RTC_ROOT")
00023 base_dir = base_dir.replace("\"", "")
00024 
00025 if base_dir == None:
00026     base_dir="C:\distribution\ImageProcessing\opencv"
00027 else:
00028     base_dir += "\\"
00029 
00030 def path_to_dir_id(path, prefix):
00031     # path = "bin/x86_win32" prefix = "omni"
00032     # output = "omni_bin_x86_win32"
00033     # "." -> "_"
00034     output = prefix + "_" + "_".join(path.split("/"))
00035     return output.replace(".", "_")
00036 
00037 
00038 def path_to_comp_id(path, prefix):
00039     # path = "bin/x86_win32" prefix = "omni"
00040     # output = "OmniBinX86_win32"
00041     # "." -> "_"
00042     output = prefix
00043     for c in path.split("/"):
00044         output += c.capitalize()
00045     return output.replace(".", "_")
00046 
00047 import makewxs
00048 
00049 for (path, files) in data:
00050     # wxs component name
00051     comp_name = path_to_comp_id(path, "OpenCVRTC")
00052     # wxs directory name
00053     dir_name = path_to_dir_id(path, "OpenCVRTC")
00054 
00055     path = path.replace("/", "\\")
00056 
00057     # full path to target directory
00058     full_path = base_dir + "\\\\" + path
00059 
00060     import glob
00061     flist = []
00062     for f in files.split(" "):
00063         flist += glob.glob(full_path + "\\" + f)
00064 
00065     cmd = ["flist",
00066            "-c", comp_name,
00067            "-o", dir_name + ".yaml",
00068            "-p",  base_dir + path]
00069     cmd += flist
00070     
00071     makewxs.main(cmd)
00072 
00073 
00074 cmd = ["wxs",
00075        "-o", "OpenCV-RTC_inc.wxs",
00076        "-i", "OpenCV-RTC_inc.wxs.in"]
00077 cmd += glob.glob("*.yaml")
00078 makewxs.main(cmd)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Thu Aug 27 2015 14:16:38