openbabel/openbabel — pull request #13 by mcs07 (2013-06-28 09:35:02+00:00)
Title: Still attempt to find Cairo even if pkgconfig fails

Under certain circumstances, pkgconfig won't successfully return the include and library paths for Cairo, however cmake will still manage to find them with find_path and find_library. This change just ensures find_path and find_library are still run, even if pkgconfig doesn't return any path hints.

Specifically, this can be an issue if Cairo is installed using Homebrew on Mac OS X, which just relies on X11/XQuartz for some of its dependencies. This is a problem because /opt/X11/lib/pkgconfig/ is not visible to pkgconfig by default, so instead of returning the include and library paths for Cairo, pkgconfig just complains that dependencies are missing (even though they aren't).

Even without the hints from pkgconfig, cmake will still manage to find the correct paths in most cases, especially if they are sensible like the Homebrew defaults of /usr/local/lib/libcairo.dylib and /usr/local/include/cairo.

Related bug report: http://sourceforge.net/p/openbabel/bugs/849/
Related homebrew issue: https://github.com/mxcl/homebrew/issues/14123