Fix build issues for Linux, Qt4 and older CMake versions