Simplify the policy check.
Restore the legacy include handling for Qt5 builds.

This is still needed on systems with an older Qt 5 (<= 5.1) and/or older
CMake (< 2.8.11).

This is a partial revert of 746004e884.