To put zlib inside the shared library, you may only need to build it with relocation enabled, but statically, and then give this library to CMake. Compiling HDF5 with the CRT in static mode may not be the best solution. You need to be absolutely sure than you don't allocate something that the HDF5 library will free, or the other way around. And even then, it's not the best idea ever (usual static CRT is for full application + static libraries, nothing must be shared in any way).
Cheers, Matthieu 2014-05-29 17:10 GMT+02:00 Allen Byrne <[email protected]>: > Andrey, > > BUILD_SHARED_LIBS determines how the library will be built, OFF is static and > ON is dynamic. > If you want to build a static hdf5 library, I suggest you link zlib in > statically as well. Note that the CRT will still be referenced dynamically. > (there is a way to link that in statically if you must, but is not usually > necessary). > > Allen > > > On Thursday, May 29, 2014 07:03:25 PM Андрей Парамонов wrote: >> Hello! >> >> I'm trying to do a custom build of HDF5 library with cmake. More >> precisely, I want to build hdf5.dll with zlib support, with zlib (and >> msvc*) code linked info hdf5.dll statically. >> >> From reading INSTALL_CMake.txt, I do not quite understand to which of >> the following aspects BUILD_SHARED_LIBS relates to: >> >> 1) Build hdf5.dll or hdf5.lib. >> 2) Link zlib code info hdf5 statically or dynamically. >> >> Sorry if my question is stupid, I didn't have a chance to get experience >> with cmake so far ;-) >> >> Best wishes, >> Andrey Paramonov > > > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org > Twitter: https://twitter.com/hdf5 -- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher Music band: http://liliejay.com/ _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
