Added cmake option for shared and static builds.