Add an option to control shared vs static library builds.

This adds an option to the CMakeCache to facilitate building shared or static libaries. In the cmake gui this is exposed as a checkbox.