add an explicit dependency on generated files in CMake

This will make sure that the generated headers are build before they are compiled.