OpenCV 2.4.x has problems with pkg-config
Created by: anjos
The following bug in the OpenCV tracker affects us (at least our OSX builds with MacPorts): http://code.opencv.org/issues/1925. Avoid upgrading to OpenCV 2.4.x until that is fixed. The last know version to work properly is 2.3.1a.
Here is a recipe to revert your Mac Ports installation to OpenCV 2.3.1a in case you need it:
$ wget --no-check-certificate https://trac.macports.org/export/90303/trunk/dports/graphics/opencv/Portfile https://trac.macports.org/export/90303/trunk/dports/graphics/opencv/files/patch-CMakeLists.txt.diff https://trac.macports.org/export/90303/trunk/dports/graphics/opencv/files/patch-install_name.diff https://trac.macports.org/export/90303/trunk/dports/graphics/opencv/files/patch-pch-CMakeLists.txt.diff $ mkdir files $ mv patch-*.diff files $ sudo port install