Fixed cmake build. Added -DUSE_QT5 flag. Fixed errors in definitions in popupwindow.cpp