Fix version detection in cmake

- use currenlty active branch when determining merge-revision
- when .git is not available use mtime of NEWS file for dateinfo