Open soloturn opened 5 years ago
Hey I'm having the same problem, I'm trying to use opencv with mason on Windows, but without luck so far. Note: pkgconfig is also not on Windows. I wish there was a opencv.wrap file, since that download and build logic always works, regardless of platform.
If the modulename is opencv4
then it should be found with dependency('opencv4')
, not dependency('opencv')
. I don't know why the pkg-config name would be different on different platforms, though.
This probably has to do with debian shipping opencv 3 and arch shippping opencv 4
@jpakkane , you would have a suggestion how this should be, considering:
i am slightly confused here. the opencv example from debian seems to allow multiple versions of opencv, but only one .pc file, while arch would allow both versions for all files. https://packages.debian.org/sid/amd64/libopencv-core3.2/filelist
/usr/lib/x86_64-linux-gnu/libopencv_core.so.3.2
/usr/share/doc/libopencv-core3.2/changelog.Debian.amd64.gz
...
https://packages.debian.org/sid/amd64/libopencv-dev/filelist
/usr/lib/x86_64-linux-gnu/pkgconfig/opencv.pc
...
let me put an example where really 2 versions of a library is there, in this case arch:
$ grep -in core /usr/lib/pkgconfig/avahi-qt*pc
/usr/lib/pkgconfig/avahi-qt4.pc:9:Requires.private: QtCore >= 4.0.0
/usr/lib/pkgconfig/avahi-qt5.pc:9:Requires: Qt5Core >= 5.0.0
how many pkg-config files should be there, what name should be mentioned in it, what name should be specifivied in the build file for the dependency so meson works?
We don't really have any say on what pc files are installed and what do they contain. That is a distro issue. We just call pkg-config and use the results. The usual solution in these cases is to do something like:
ocv_dep = dependency('opencv', required: false)
if not ocv_dep.found()
ocv_dep = dependency('opencv4')
endif
I looked at the arch package, they aren't patching the sources. it doesn't look like debian is either. This appears to be a case of opencv upstream changing their pkg-config names to allow opencv 3.x and 4.x to be co-installed.
gnome shotwell depends on opencv and has:
arch linux has opencv installed:
despite when building shotwell it gives the error:
the log says it calls
while the following would give a result:
not sure where the error is? is it shotwell? meson? pkg-config?