Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 OpenCV_files = "README OpenCVConfig.cmake"
00018
00019 data = [
00020 ("", OpenCV_files),
00021 ("bin", "*.dll"),
00022 ("include/opencv", "*.h *.hpp"),
00023 ("lib", "*.lib"),
00024 ("doc", "license.txt opencv.pdf")
00025 ]
00026
00027 import os
00028 base_dir = os.getenv("OPENCV_ROOT")
00029 base_dir = base_dir.replace("\"", "")
00030
00031 if base_dir == None:
00032 base_dir="C:\\OpenCV2.1"
00033 else:
00034 base_dir += "\\"
00035
00036 def path_to_dir_id(path, prefix):
00037
00038
00039
00040 output = prefix + "_" + "_".join(path.split("/"))
00041 return output.replace(".", "_")
00042
00043
00044 def path_to_comp_id(path, prefix):
00045
00046
00047
00048 output = prefix
00049 for c in path.split("/"):
00050 output += c.capitalize()
00051 return output.replace(".", "_")
00052
00053 import makewxs
00054
00055 for (path, files) in data:
00056
00057 comp_name = path_to_comp_id(path, "OpenCV")
00058
00059 dir_name = path_to_dir_id(path, "OpenCV")
00060
00061 path = path.replace("/", "\\")
00062
00063
00064 full_path = base_dir + "\\\\" + path
00065
00066 import glob
00067 flist = []
00068 for f in files.split(" "):
00069 flist += glob.glob(full_path + "\\" + f)
00070
00071 cmd = ["flist",
00072 "-c", comp_name,
00073 "-o", dir_name + ".yaml",
00074 "-p", base_dir + path]
00075 cmd += flist
00076
00077 makewxs.main(cmd)
00078
00079 import re
00080 if None != re.search('2\.2',base_dir):
00081 cmd = ["wxs",
00082 "-o", "OpenCV_inc.wxs",
00083 "-i", "OpenCV22_inc.wxs.in"]
00084 else:
00085 cmd = ["wxs",
00086 "-o", "OpenCV_inc.wxs",
00087 "-i", "OpenCV_inc.wxs.in"]
00088
00089 cmd += glob.glob("*.yaml")
00090 makewxs.main(cmd)