Enh/cmakification

There is a few options which are introduced for this CMake setup, so e.g. you can instruct to build with dynamic linking (or static linking with OFF) using

```
mkdir -p build; cd build; cmake -DBUILD_SHARED_LIBS:BOOL=ON ..; PATH=/usr/lib/ccache:$PATH make
```