Cmake generate with clean source tree

Moves generated files out of source to binary tree and fixes it's dependencies.