How find package in CMake with a custom path for OpenCV framework in iOS

I have CMake 3.0 and my own iOS project in C++ that use OpenCV as dependency. That project generate a group of libraries loaded by and application project.

In my CMake, I try to look for OpenCV dependency, It automatically in windows and linux, but in Android & iOS I have to set the correct package. With Android, setting ${OpenCV_dir}/sdk/native/jni works property with this code:

SET(OpenCV_DIR NOT_FOUND CACHE PATH "Path to use OpenCV")
IF(OpenCV_DIR STREQUAL NOT_FOUND)
  FIND_PACKAGE( OpenCV PATHS ${OpenCV_DIR})
  MESSAGE(FATAL_ERROR "--***-- Warning: Install and configure path to prebuilt OpenCVConfig.cmake")
ENDIF()

In iOS, this doesnt work. I usually create project Xcode project WITHOUT find OpenCV and then I drag and drop the framework and configure manually variable Framework Search Path with a custom path, in

/Users/Piperoman/Libraries/opencv2.4.9IOS

but using the CMake code doesnt find it.

What is the problem locating the framework?


Source: c++

Leave a Reply