Remove explicit CMake command to build shared library.
Add option to toggle building shared libraries. Default is set to OFF, meaning that unless BUILD_SHARED_LIBS is switched ON, static libraries will be built.