Commit e6784ca8 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #1021 from alekcac:platforms

parents c244f000 bb9a0b72
...@@ -37,7 +37,7 @@ Building OpenCV from Source, using CMake and Command Line ...@@ -37,7 +37,7 @@ Building OpenCV from Source, using CMake and Command Line
.. code-block:: bash .. code-block:: bash
cd ~/<my_working_directory> 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. 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.
......
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneOS ../opencv
cmake -GXcode -DCMAKE_TOOLCHAIN_FILE=../opencv/ios/cmake/Toolchains/Toolchain-iPhoneSimulator_Xcode.cmake -DCMAKE_INSTALL_PREFIX=../OpenCV_iPhoneSimulator ../opencv
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
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<key>CFBundleName</key> <key>CFBundleName</key>
<string>OpenCV</string> <string>OpenCV</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.itseez.opencv</string> <string>org.opencv</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${VERSION}</string> <string>${VERSION}</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
......
...@@ -38,7 +38,7 @@ def build_opencv(srcroot, buildroot, target, arch): ...@@ -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" # for some reason, if you do not specify CMAKE_BUILD_TYPE, it puts libs to "RELEASE" rather than "Release"
cmakeargs = ("-GXcode " + cmakeargs = ("-GXcode " +
"-DCMAKE_BUILD_TYPE=Release " + "-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 " + "-DBUILD_opencv_world=ON " +
"-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target) "-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target)
# if cmake cache exists, just rerun cmake to update OpenCV.xproj if necessary # if cmake cache exists, just rerun cmake to update OpenCV.xproj if necessary
...@@ -92,16 +92,13 @@ def put_framework_together(srcroot, dstroot): ...@@ -92,16 +92,13 @@ def put_framework_together(srcroot, dstroot):
os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2") os.system("lipo -create " + wlist + " -o " + dstdir + "/opencv2")
# form Info.plist # 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") dstfile = open(dstdir + "/Resources/Info.plist", "wt")
for l in srcfile.readlines(): for l in srcfile.readlines():
dstfile.write(l.replace("${VERSION}", opencv_version)) dstfile.write(l.replace("${VERSION}", opencv_version))
srcfile.close() srcfile.close()
dstfile.close() dstfile.close()
# copy cascades
# TODO ...
# make symbolic links # make symbolic links
os.symlink("A", "Versions/Current") os.symlink("A", "Versions/Current")
os.symlink("Versions/Current/Headers", "Headers") os.symlink("Versions/Current/Headers", "Headers")
...@@ -125,4 +122,4 @@ if __name__ == "__main__": ...@@ -125,4 +122,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 \ No newline at end of file
...@@ -4,12 +4,12 @@ set (IPHONEOS TRUE) ...@@ -4,12 +4,12 @@ set (IPHONEOS TRUE)
# Standard settings # Standard settings
set (CMAKE_SYSTEM_NAME iOS) set (CMAKE_SYSTEM_NAME iOS)
# Include extra modules for the iOS platform files # 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) include (CMakeForceCompiler)
#CMAKE_FORCE_C_COMPILER (gcc gcc) #CMAKE_FORCE_C_COMPILER (clang GNU)
#CMAKE_FORCE_CXX_COMPILER (g++ g++) #CMAKE_FORCE_CXX_COMPILER (clang++ GNU)
set (CMAKE_C_SIZEOF_DATA_PTR 4) set (CMAKE_C_SIZEOF_DATA_PTR 4)
set (CMAKE_C_HAS_ISYSROOT 1) set (CMAKE_C_HAS_ISYSROOT 1)
......
...@@ -4,12 +4,12 @@ set (IPHONESIMULATOR TRUE) ...@@ -4,12 +4,12 @@ set (IPHONESIMULATOR TRUE)
# Standard settings # Standard settings
set (CMAKE_SYSTEM_NAME iOS) set (CMAKE_SYSTEM_NAME iOS)
# Include extra modules for the iOS platform files # 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) include (CMakeForceCompiler)
#CMAKE_FORCE_C_COMPILER (gcc gcc) #CMAKE_FORCE_C_COMPILER (clang GNU)
#CMAKE_FORCE_CXX_COMPILER (g++ g++) #CMAKE_FORCE_CXX_COMPILER (clang++ GNU)
set (CMAKE_C_SIZEOF_DATA_PTR 4) set (CMAKE_C_SIZEOF_DATA_PTR 4)
set (CMAKE_C_HAS_ISYSROOT 1) set (CMAKE_C_HAS_ISYSROOT 1)
......
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
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