mirror of
https://github.com/opencv/opencv.git
synced 2024-11-27 20:50:25 +08:00
moved iOS part to platforms folder
This commit is contained in:
parent
b84296c02e
commit
68741bf8a0
@ -37,7 +37,7 @@ Building OpenCV from Source, using CMake and Command Line
|
||||
.. code-block:: bash
|
||||
|
||||
cd ~/<my_working_directory>
|
||||
python opencv/ios/build_framework.py ios
|
||||
python opencv/platforms/ios/build_framework.py ios
|
||||
|
||||
If everything's fine, a few minutes later you will get ~/<my_working_directory>/ios/opencv2.framework. You can add this framework to your Xcode projects.
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneOS ../opencv
|
@ -1 +0,0 @@
|
||||
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneSimulator ../opencv
|
@ -1,15 +0,0 @@
|
||||
Assuming that your build directory is on the same level that opencv source,
|
||||
From the build directory run
|
||||
../opencv/ios/configure-device_xcode.sh
|
||||
or
|
||||
../opencv/ios/configure-simulator_xcode.sh
|
||||
|
||||
Then from the same folder invoke
|
||||
|
||||
xcodebuild -sdk iphoneos -configuration Release -target ALL_BUILD
|
||||
xcodebuild -sdk iphoneos -configuration Release -target install install
|
||||
|
||||
or
|
||||
|
||||
xcodebuild -sdk iphonesimulator -configuration Release -target ALL_BUILD
|
||||
xcodebuild -sdk iphonesimulator -configuration Release -target install install
|
@ -5,7 +5,7 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>OpenCV</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.itseez.opencv</string>
|
||||
<string>opencv.org</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${VERSION}</string>
|
||||
<key>CFBundleShortVersionString</key>
|
@ -38,7 +38,7 @@ def build_opencv(srcroot, buildroot, target, arch):
|
||||
# for some reason, if you do not specify CMAKE_BUILD_TYPE, it puts libs to "RELEASE" rather than "Release"
|
||||
cmakeargs = ("-GXcode " +
|
||||
"-DCMAKE_BUILD_TYPE=Release " +
|
||||
"-DCMAKE_TOOLCHAIN_FILE=%s/ios/cmake/Toolchains/Toolchain-%s_Xcode.cmake " +
|
||||
"-DCMAKE_TOOLCHAIN_FILE=%s/platforms/ios/cmake/Toolchains/Toolchain-%s_Xcode.cmake " +
|
||||
"-DBUILD_opencv_world=ON " +
|
||||
"-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target)
|
||||
# if cmake cache exists, just rerun cmake to update OpenCV.xproj if necessary
|
||||
@ -92,16 +92,13 @@ def put_framework_together(srcroot, dstroot):
|
||||
os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2")
|
||||
|
||||
# form Info.plist
|
||||
srcfile = open(srcroot + "/ios/Info.plist.in", "rt")
|
||||
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 cascades
|
||||
# TODO ...
|
||||
|
||||
# make symbolic links
|
||||
os.symlink("A", "Versions/Current")
|
||||
os.symlink("Versions/Current/Headers", "Headers")
|
||||
@ -125,4 +122,4 @@ if __name__ == "__main__":
|
||||
print "Usage:\n\t./build_framework.py <outputdir>\n\n"
|
||||
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]))
|
@ -4,12 +4,12 @@ set (IPHONEOS TRUE)
|
||||
# Standard settings
|
||||
set (CMAKE_SYSTEM_NAME iOS)
|
||||
# Include extra modules for the iOS platform files
|
||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/ios/cmake/Modules")
|
||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/cmake/Modules")
|
||||
|
||||
# Force the compilers to gcc for iOS
|
||||
# Force the compilers to clang for iOS
|
||||
include (CMakeForceCompiler)
|
||||
#CMAKE_FORCE_C_COMPILER (gcc gcc)
|
||||
#CMAKE_FORCE_CXX_COMPILER (g++ g++)
|
||||
#CMAKE_FORCE_C_COMPILER (clang GNU)
|
||||
#CMAKE_FORCE_CXX_COMPILER (clang++ GNU)
|
||||
|
||||
set (CMAKE_C_SIZEOF_DATA_PTR 4)
|
||||
set (CMAKE_C_HAS_ISYSROOT 1)
|
@ -4,12 +4,12 @@ set (IPHONESIMULATOR TRUE)
|
||||
# Standard settings
|
||||
set (CMAKE_SYSTEM_NAME iOS)
|
||||
# Include extra modules for the iOS platform files
|
||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/ios/cmake/Modules")
|
||||
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/cmake/Modules")
|
||||
|
||||
# Force the compilers to gcc for iOS
|
||||
# Force the compilers to clang for iOS
|
||||
include (CMakeForceCompiler)
|
||||
#CMAKE_FORCE_C_COMPILER (gcc gcc)
|
||||
#CMAKE_FORCE_CXX_COMPILER (g++ g++)
|
||||
#CMAKE_FORCE_C_COMPILER (clang GNU)
|
||||
#CMAKE_FORCE_CXX_COMPILER (clang++ GNU)
|
||||
|
||||
set (CMAKE_C_SIZEOF_DATA_PTR 4)
|
||||
set (CMAKE_C_HAS_ISYSROOT 1)
|
7
platforms/ios/readme.txt
Normal file
7
platforms/ios/readme.txt
Normal file
@ -0,0 +1,7 @@
|
||||
Building OpenCV from Source, using CMake and Command Line
|
||||
=========================================================
|
||||
|
||||
cd ~/<my_working_directory>
|
||||
python opencv/platforms/ios/build_framework.py ios
|
||||
|
||||
If everything's fine, a few minutes later you will get ~/<my_working_directory>/ios/opencv2.framework. You can add this framework to your Xcode projects.
|
Loading…
Reference in New Issue
Block a user