updated CMakeLists for dynamic compilation
updated with some examples, needed small change to quiet hdf5 error