cmake: make build independant of build-dir source-dir location

The old version depended on the build-dir to be a subdirectory of the
source directory.
With this patch one can build in tree or put the build-dir anywhere.

Signed-off-by: Henning Schild <henning...@siemens.com>