Add cmake support for out-of-tree compilation