Fix building the iOS framework after I dropped the VERSION macro.

This version uses CMake to generate Info.plist, which should be more
reliable than the old approach.
This commit is contained in:
Roman Donchenko
2013-08-06 18:56:36 +04:00
parent 2911b12145
commit 5dd598fc6d
4 changed files with 10 additions and 19 deletions

View File

@@ -71,15 +71,6 @@ def put_framework_together(srcroot, dstroot):
os.makedirs(framework_dir)
os.chdir(framework_dir)
# determine OpenCV version (without subminor part)
tdir0 = "../build/" + targetlist[0]
cfg = open(tdir0 + "/cvconfig.h", "rt")
for l in cfg.readlines():
if l.startswith("#define VERSION"):
opencv_version = l[l.find("\"")+1:l.rfind(".")]
break
cfg.close()
# form the directory tree
dstdir = "Versions/A"
os.makedirs(dstdir + "/Resources")
@@ -91,13 +82,8 @@ def put_framework_together(srcroot, dstroot):
wlist = " ".join(["../build/" + t + "/lib/Release/libopencv_world.a" for t in targetlist])
os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2")
# form Info.plist
srcfile = open(srcroot + "/platforms/ios/Info.plist.in", "rt")
dstfile = open(dstdir + "/Resources/Info.plist", "wt")
for l in srcfile.readlines():
dstfile.write(l.replace("${VERSION}", opencv_version))
srcfile.close()
dstfile.close()
# copy Info.plist
shutil.copyfile("../build/ios/Info.plist", dstdir + "/Resources/Info.plist")
# make symbolic links
os.symlink("A", "Versions/Current")