I am building opencv-3.1.0
and I want to use ffmpeg
, which is installed in custom path /media/sdcard/usr/lib
, /media/sdcard/usr/include
.
Normally, linker gives me an error:
/usr/lib/gcc/i586-poky-linux/4.9.1/../../../../i586-poky-linux/bin/ld: cannot find -lavcodec
So I gave cmake some additional flags: -DCMAKE_SHARED_LINKER_FLAGS="--library-path /media/sdcard/usr/lib", DCMAKE_INCLUDE_PATH=/media/sdcard/usr/include
.
Include seems not to work at all, but as for linker flags, cmake
gave me the following output:
Linker flags (Release): --library-path /media/sdcard/usr/lib
Linker flags (Debug): --library-path /media/sdcard/usr/lib
But when I tried to run make
, I got an error:
c++: error: unrecognized command line option '--library-path'
My ld knows '--library-path' flag and finds necessary libraries, e.g. if I run
ld -lavcodec --library-path /media/sdcard/usr/lib --verbose
it gives me
attempt to open /media/sdcard/usr/lib/libavcodec.a succeeded
I may be missing some ground understanding of the whole process.