Merge pull request #1234 from SpecLad:ios-plist
This commit is contained in:
commit
9bb1a7d34d
@ -497,6 +497,8 @@ include(cmake/OpenCVGenAndroidMK.cmake)
|
|||||||
# Generate OpenCVСonfig.cmake and OpenCVConfig-version.cmake for cmake projects
|
# Generate OpenCVСonfig.cmake and OpenCVConfig-version.cmake for cmake projects
|
||||||
include(cmake/OpenCVGenConfig.cmake)
|
include(cmake/OpenCVGenConfig.cmake)
|
||||||
|
|
||||||
|
# Generate Info.plist for the IOS framework
|
||||||
|
include(cmake/OpenCVGenInfoPlist.cmake)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Summary:
|
# Summary:
|
||||||
|
4
cmake/OpenCVGenInfoPlist.cmake
Normal file
4
cmake/OpenCVGenInfoPlist.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if(IOS)
|
||||||
|
configure_file("${OpenCV_SOURCE_DIR}/platforms/ios/Info.plist.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/ios/Info.plist")
|
||||||
|
endif()
|
@ -7,9 +7,9 @@
|
|||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.opencv</string>
|
<string>org.opencv</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${VERSION}</string>
|
<string>${OPENCV_LIBVERSION}</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>${VERSION}</string>
|
<string>${OPENCV_LIBVERSION}</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
|
@ -71,19 +71,11 @@ def put_framework_together(srcroot, dstroot):
|
|||||||
os.makedirs(framework_dir)
|
os.makedirs(framework_dir)
|
||||||
os.chdir(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
|
# form the directory tree
|
||||||
dstdir = "Versions/A"
|
dstdir = "Versions/A"
|
||||||
os.makedirs(dstdir + "/Resources")
|
os.makedirs(dstdir + "/Resources")
|
||||||
|
|
||||||
|
tdir0 = "../build/" + targetlist[0]
|
||||||
# copy headers
|
# copy headers
|
||||||
shutil.copytree(tdir0 + "/install/include/opencv2", dstdir + "/Headers")
|
shutil.copytree(tdir0 + "/install/include/opencv2", dstdir + "/Headers")
|
||||||
|
|
||||||
@ -91,13 +83,8 @@ def put_framework_together(srcroot, dstroot):
|
|||||||
wlist = " ".join(["../build/" + t + "/lib/Release/libopencv_world.a" for t in targetlist])
|
wlist = " ".join(["../build/" + t + "/lib/Release/libopencv_world.a" for t in targetlist])
|
||||||
os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2")
|
os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2")
|
||||||
|
|
||||||
# form Info.plist
|
# copy Info.plist
|
||||||
srcfile = open(srcroot + "/platforms/ios/Info.plist.in", "rt")
|
shutil.copyfile(tdir0 + "/ios/Info.plist", dstdir + "/Resources/Info.plist")
|
||||||
dstfile = open(dstdir + "/Resources/Info.plist", "wt")
|
|
||||||
for l in srcfile.readlines():
|
|
||||||
dstfile.write(l.replace("${VERSION}", opencv_version))
|
|
||||||
srcfile.close()
|
|
||||||
dstfile.close()
|
|
||||||
|
|
||||||
# make symbolic links
|
# make symbolic links
|
||||||
os.symlink("A", "Versions/Current")
|
os.symlink("A", "Versions/Current")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user