Try to fix a race condition.
mboxresource.cpp includes compactpage.h which includes ui_compactpage.h Let's ensure the ui files are generated before trying to build the akonadi_mbox_resource target.