Detecting contrib version with preprocessor
Hello everyone,
I am working on a project, which ports OpenCV and several contrib modules to node.js. Therefore I need to detect the OpenCV contrib version at compile time, but I have noticed, that there is no such macro as CV_MINOR_VERSION for contrib.
This is crucial for my package to ensure compatibility across different OpenCV versions. For example contrib 3.0 apparently does not implement MultiTracker, which caused users installing my package with contrib to run into compilation errors for the tracker module bindings.
isn't it the other way round ? wouldn't you rather proactively request / checkout a certain release or branch ?
People that install the npm package have any minor version of OpenCV 3 and eventually any contrib version installed. Depending on which version they have set up I have to exclude some nodejs bindings from the compilation e.g. if a class is not implemented in that version. For OpenCV this works fine via CV_MINOR_VERSION, but not for contrib.
note, that you would need exactly the same opencv_contrib version, as your main opencv has, else you run into subtle build problems. this is not an "option" (e.g. based on features) for your users to choose.
you will also need the src code for both repos, not some "preinstalled" nodejs bindings. (but maybe i misunderstand you here)
just curious, are you auto-generating the bindings ?
I am writing the bindings with the native nodejs API in C++. The bindings can then be installed via npm, which compiles and bundles them with node-gyp. If you are interested you can have a look at: opencv4nodejs.
But the info that main opencv and contrib version have to match is helping. Under that assumption checking the CV_MINOR_VERSION would be sufficient to exclude certain contrib bindings. I thought there would be scenarios, where people would use a contrib version that differs from main version for some reason (for example opencv3.3 with contrib3.2).
Thanks for your help.
quite impressive, best of luck with it !
(from an node / npm / js hater...)
Thanks! :D