iOS C++ plugin that itself relies on framework

From my understanding, basic iOS C++ plugins are dead simple. Simply jot down working code in a .mm text file and shove that file into Assets/Plugin/iOS. Even simpler than making a windows .dll plugin.

But… what about an iOS plugin that itself makes calls to another framework like, say, OpenCV? How do you include that? The documentation beyond the most basic examples like the one I linked is sparse. Do I just dump opencv2.framework into Assets/Plugin/iOS and cross my fingers my own C++ code will know to talk to OpenCV’s through some kind of magic? I am pretty sure there must be some additional steps, probably once the generated project’s gotten to Xcode’s side of things. What would these steps be?

Any help or link to a tutorial or documentation pertinent to my use case highly appreciated. Thanks!

In Xcode I made a static library (a .a file) implementing the header and source for my methods. That static library was linked to the OpenCV for iOS framework. I had to make sure to copy the framework’s Headers and Resources subfolders and opencv2 file, all located in Versions\A, back to the root of the framework.

I could then place the static library and the OpenCV for iOS framework in my Unity iOS plugin folder, and use the library from Unity script as I would a .dll or .so through [DllImport (“__Internal”)].