Move away from deprecated macros, and use imported targets instead

See https://qt.gitorious.org/qt/qtbase/commit/d9ea4bb1441534cfb9253303ac258951dfcc4d9e