I'm using OpenCV in an iOS project but I'm having problems because the framework includes libpng and libjpeg, which my project also includes. This is causing duplicate symbols during link.
I'd like to point OpenCV at my own copies of libjpeg/png but I can't find any way to make that work. I tried setting the build variables BUILD_PNG and BUILD_JPEG to NO but that didn't have any effect and setting WITH_JPEG and WITH_PNG to NO caused the APIs to fail at runtime when I tried writing images due to the missing support.
I also considered just pointing my project at the OpenCV Framework's libjpeg/png headers but those aren't exposed through the framework. I could pull the source for the version in the framework and build against those headers so that the linkage would match, but yuck.
What is the right way to use OpenCV on iOS in a project which also uses libpng and libjpeg?