dune
dune copied to clipboard
Cmake: add opencv_videoio, new library in openCV 3.X.X
Should be seen in the context of https://github.com/LSTS/glued/pull/36
Will leave it to @pmfg to decide on this (he has been working with OpenCV on our side).
It will require a check for the opencv version used, since version 2.4.x does not have the opencv_videoio library (compatibility with the old opencv version - https://github.com/LSTS/glued/pull/36)
To clarify: Will the following changes suffice?
- add a new rule to glued, called opencv3, that is identical to the opencv rule except that it is updated to version 3.X.X (and a different checksum ofc). Or is there a smarter way to keep track of different versions?
- within the if(HAVE_LIB_OPENCV) in cmake/Libraries/OpenCV.cmake; run something like CHECK_LIBRARY_EXISTS(opencv_videoio open "" HAVE_LIB_OPENCV3). If HAVE_LIB_OPENCV3 is true, we'll add opencv_videoio and do set(DUNE_SYS_HAS_OPENCV3 1 CACHE INTERNAL "OpenCV library") videoio ref
- Tasks that require OpenCV 3.X.X will need to check DUNE_SYS_HAR_OPENCV3, while older tasks (requiring 2.X.X) do not have to change their cmake.
Please be critical, as I'm no cmake expert!
For me it seems like a good solution to the incompatibility of opencv versions.