OpenCV: how to split it up into components

[This article documents my ongoing attempts to get OpenCV working in UWP apps]


My goal is to figure out how to package OpenCV up into several individual NuGet packages. For instance, I expect that these files would all be packaged together into a single "OpenCV.native.flann" package. The question is, which other similar NuGet packages would it depend upon?

  • DLL: opencv_flann300.dll
  • import library: opencv_flann300.lib
  • include file: opencv2\flann.hpp
  • include files: opencv2\flann\*.h*


I looked through every DLL that makes up OpenCV and used "dumpbin" to figure out which ones depend on which others. I also looked through all the header files in the include directory to see which ones depend on which others. (I also looked at how the project files in GitHub Microsoft/opencv/tree/vs2015-samples claim to depend upon each other, but that seemed to include superfluous dependencies - ones that aren't reflected in dumpbin or in include files - so I discounted them).


The end result is this dependency graph below. This shows all the NuGet packages that I intended to create. For instance, the "OpenCV.native.flann" package will include all the files listed above, and it will have a NuGet dependency solely upon "OpenCV.native.core". A few packages also need to contain extra header files, beyond those that follow the example of "flann", and they're indicated in the graph below.


(Note: the picture above seems to have cut off the final line of headers that go into the package allheaders. It should also have included "opencv\cv.h, cv.hpp, cvaux.h*").

It's mysterious that these allheaders headers from OpenCV don't also include the headers for shape and stitching and videostab and winrt. I'm undecided whether to create an "opencv.native.complete" NuGet package that depends upon every single package, or merely the ones suggested by the "opencv.hpp" header file.