mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
410b6fdd97
OpenCV requires C++17, and bundled 3rdparty libraries such as KleidiCV explicitly request CXX_STANDARD 17. With the CMake Xcode generator, however, neither the global CMAKE_CXX_STANDARD nor per-target CXX_STANDARD is emitted as CLANG_CXX_LANGUAGE_STANDARD in the generated project, so those sources are compiled at the toolchain default (pre-C++17) and fail, e.g.: kleidicv/include/kleidicv/traits.h: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'? Set CLANG_CXX_LANGUAGE_STANDARD=gnu++17 at the project level via CMAKE_XCODE_ATTRIBUTE_* in the shared getCMakeArgs(), so every target in the generated Xcode project (including 3rdparty subprojects) builds with C++17.
Building OpenCV from Source, using CMake and Command Line ========================================================= cd ~/<my_working_directory> python3 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.