Refactor build script.

Use CMake's native automoc support.
Tiny change.
Adjust copyright template.