Get it to build on OS X 10.8 with qt4, qt5 and swi-prolog from macports.