skip search for Qt4/KDE4 when ENABLE_QT4==OFF and set compiler opts early
Don't do unnecessary work which can fail, e.g. because find_package(KDE4)
will try to use Qt5. Also prevent failing checks in FindKDE4.cmake due
to missing compiler flags (notably -std=c++11).