I have turned WITH_PYSPATIALITE ON, but I have a custom build of SpatiaLite (4.0.0), not the packaged version, so I set WITH_INTERNAL_SPATIALITE to OFF. How do I tell QGIS to configure PYSPATIALITE for 4.0.0? Or should I turn WITH_PYSPATIALITE OFF and install it myself?
Turned out that WITH_INTERNAL_SPATIALITE = OFF is required to install QGIS with SpatiaLite 4 and not with the one that is shipped with QGIS (quite self-evident actually).
WITH_PYSPATIALITE = ON flawlessly installed Pyspatialite and it works like a charm with SpatiaLite 4.