What's the best way to compile and include a static library (in this case OpenCV) for use in a R package distributed as a binary package. Should I compile it as static outside of R and then put relevant .a files in "inst" or should I include all the source and header files of OpenCV in "inst" and compile from R?
I understand that CRAN will never accept this but it's more for the purpose of making deployment easier for users so they do not need to compile OpenCV or the package from source themselves.
If I get some good pointers on how to proceed or a package that have done something similar I intend to write up a short blog post for other people who want to do the same thing but with other large external libraries (both on Linux, OSX and Windows).
I apologies before hand if I've failed to appreciate that this question has been asked several times before.