Added CMake option to build shared library