I am building a C library that uses HDF5 as an internal dependency to read data from an HDF5 file with zlib compressed data. I need to ship my library as a self-contained static library on Linux and therefore I would like to compile libhdf5.a self-contained including zlib. Can someone tell me how to use CMake to achieve this?