Commit 1770ba1d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #66 from alekcac/ios-armv7s

added support armv7s for iOS framework; tested on my computer (OSX 10.8, Xcode 4.5)
parents 8e2f729a 2dba13f7
...@@ -27,10 +27,10 @@ However, OpenCV.framework directory is erased and recreated on each run. ...@@ -27,10 +27,10 @@ However, OpenCV.framework directory is erased and recreated on each run.
import glob, re, os, os.path, shutil, string, sys import glob, re, os, os.path, shutil, string, sys
def build_opencv(srcroot, buildroot, target): def build_opencv(srcroot, buildroot, target, arch):
"builds OpenCV for device or simulator" "builds OpenCV for device or simulator"
builddir = os.path.join(buildroot, target) builddir = os.path.join(buildroot, target + '-' + arch)
if not os.path.isdir(builddir): if not os.path.isdir(builddir):
os.makedirs(builddir) os.makedirs(builddir)
currdir = os.getcwd() currdir = os.getcwd()
...@@ -52,8 +52,8 @@ def build_opencv(srcroot, buildroot, target): ...@@ -52,8 +52,8 @@ def build_opencv(srcroot, buildroot, target):
if os.path.isfile(wlib): if os.path.isfile(wlib):
os.remove(wlib) os.remove(wlib)
os.system("xcodebuild -parallelizeTargets -jobs 8 -sdk %s -configuration Release -target ALL_BUILD" % target.lower()) os.system("xcodebuild -parallelizeTargets ARCHS=%s -jobs 8 -sdk %s -configuration Release -target ALL_BUILD" % (arch, target.lower()))
os.system("xcodebuild -sdk %s -configuration Release -target install install" % target.lower()) os.system("xcodebuild ARCHS=%s -sdk %s -configuration Release -target install install" % (arch, target.lower()))
os.chdir(currdir) os.chdir(currdir)
def put_framework_together(srcroot, dstroot): def put_framework_together(srcroot, dstroot):
...@@ -112,8 +112,10 @@ def put_framework_together(srcroot, dstroot): ...@@ -112,8 +112,10 @@ def put_framework_together(srcroot, dstroot):
def build_framework(srcroot, dstroot): def build_framework(srcroot, dstroot):
"main function to do all the work" "main function to do all the work"
for target in ["iPhoneOS", "iPhoneSimulator"]: targets = ["iPhoneOS", "iPhoneOS", "iPhoneSimulator"]
build_opencv(srcroot, os.path.join(dstroot, "build"), target) archs = ["armv7", "armv7s", "i386"]
for i in range(len(targets)):
build_opencv(srcroot, os.path.join(dstroot, "build"), targets[i], archs[i])
put_framework_together(srcroot, dstroot) put_framework_together(srcroot, dstroot)
...@@ -123,4 +125,4 @@ if __name__ == "__main__": ...@@ -123,4 +125,4 @@ if __name__ == "__main__":
print "Usage:\n\t./build_framework.py <outputdir>\n\n" print "Usage:\n\t./build_framework.py <outputdir>\n\n"
sys.exit(0) sys.exit(0)
build_framework(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")), os.path.abspath(sys.argv[1])) build_framework(os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "..")), os.path.abspath(sys.argv[1]))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment