def checkCMakeVersion(self): if get_xcode_version() >= (12, 2): assert get_cmake_version() >= ( 3, 19 ), "CMake 3.19 or later is required when building with Xcode 12.2 or greater. Current version is {}".format( get_cmake_version()) else: assert get_cmake_version() >= ( 3, 17 ), "CMake 3.17 or later is required. Current version is {}".format( get_cmake_version())
from cv_build_utils import execute, print_error, print_header, get_xcode_version, get_cmake_version if __name__ == "__main__": # Check for dependencies assert sys.version_info >= ( 3, 6), "Python 3.6 or later is required! Current version is {}".format( sys.version_info) # Need CMake 3.18.5/3.19 or later for a Silicon-related fix to building for the iOS Simulator. # See https://gitlab.kitware.com/cmake/cmake/-/issues/21425 for context. assert get_cmake_version() >= ( 3, 18, 5), "CMake 3.18.5 or later is required. Current version is {}".format( get_cmake_version()) # Need Xcode 12.2 for Apple Silicon support assert get_xcode_version() >= (12, 2), \ "Xcode 12.2 command line tools or later are required! Current version is {}. ".format(get_xcode_version()) + \ "Run xcode-select to switch if you have multiple Xcode installs." # Parse arguments description = """ This script builds OpenCV into an xcframework supporting the Apple platforms of your choice. """ epilog = """ Any arguments that are not recognized by this script are passed through to the ios/osx build_framework.py scripts. """ parser = argparse.ArgumentParser(description=description, epilog=epilog) parser.add_argument( '-o', '--out', metavar='OUTDIR',
import sys, os, argparse, pathlib, traceback from cv_build_utils import execute, print_error, print_header, get_xcode_version, get_cmake_version if __name__ == "__main__": # Check for dependencies assert sys.version_info >= ( 3, 6 ), f"Python 3.6 or later is required! Current version is {sys.version_info}" # Need CMake 3.18.5/3.19 or later for a Silicon-related fix to building for the iOS Simulator. # See https://gitlab.kitware.com/cmake/cmake/-/issues/21425 for context. assert get_cmake_version() >= ( 3, 18, 5 ), f"CMake 3.18.5 or later is required. Current version is {get_cmake_version()}" # Need Xcode 12.2 for Apple Silicon support assert get_xcode_version() >= ( 12, 2 ), f"Xcode 12.2 command line tools or later are required! Current version is {get_xcode_version()}. \ Run xcode-select to switch if you have multiple Xcode installs." # Parse arguments description = """ This script builds OpenCV into an xcframework supporting the Apple platforms of your choice. """ epilog = """ Any arguments that are not recognized by this script are passed through to the ios/osx build_framework.py scripts. """ parser = argparse.ArgumentParser(description=description, epilog=epilog) parser.add_argument( 'out', metavar='OUTDIR',