.. 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.
+++ /dev/null
-cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneOS ../opencv
+++ /dev/null
-cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneSimulator ../opencv
+++ /dev/null
-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
\ No newline at end of file
<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>
# 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
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")
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]))
\ No newline at end of file
+ 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
# 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)
# 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)
--- /dev/null
+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.
\ No newline at end of file