It seems upgrading to Ubuntu 13.04 breaks a few things in the QGIS build process. Here’s some quick workarounds I’ve found to get it building again.

Firstly, Ubuntu defaults to Qt 5, causing the error:

CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:1216 (message):

 Found unsuitable Qt version "5.0.1" from /usr/bin/qmake, this code requires
 Qt 4.x

This can be fixed by switching the system default back to Qt 4, so that  qmake refers to the Qt 4 version. The “qt4-default” package handles this switch for you, so just run:

sudo apt-get install qt4-default

Update: A better solution was found by Pierre and Pvanb and is described here. Basically it involves changing the QMAKE_EXECUTABLE option from /usr/bin/qmake to /usr/bin/qmake-qt4.

Next, I was getting the error:

make[2]: *** No rule to make target `/usr/lib/libpython2.7.so', needed by `output/lib/libqgispython.so.1.9.0'. Stop.

I’m not sure if this is the correct solution, but setting up some links and re-running ldconfig gets around this:

sudo ln -sf /usr/lib/x86_64-linux-gnu/libpython2.7.so.1 /usr/lib/libpython2.7.so.1
sudo ln -sf /usr/lib/x86_64-linux-gnu/libpython2.7.so /usr/lib/libpython2.7.so
sudo ldconfig

Update: a better solution is to change the PYTHON_LIBRARY option from /usr/lib/libpython2.7.so to /usr/lib/x86_64-linux-gnu/libpython2.7.so

These two changes were enough to get QGIS building again. If you’ve got a better solution for these errors, let me know…