cmake stuff

Andrew, here I'm trying to merge my stuff into your repository. Evgeny