Add CMake config to build with either Qt4 or Qt5

Adds the ability to build the core library with Qt4 too, so that this library can be used in projects that aim for supporting Qt4 and Qt5.