add cmake option FIND_SHARED_LIBS

Defaults to ${BUILD_SHARED_LIBS} and lets the user decide if
static or shared versions of third-party libraries are
searched.

Only applied to HDF5 for now.