Refactor build script.

Use CMake's native automoc support.
Tiny change.