Enabled building a shared library with CMake

Hi. I needed to build your product as a shared library to utilize in my application. I whipped up the configs to build it with CMake, and it works like a charm. I hope you'll consider merging so that others can benefit too.