To build HDF5 fully static using CMake, you must enable the UserMacro feature. 
See the short section, 
   "VII. User Defined Options for HDF5 Libraries with CMake"
in the INSTALL_CMake.txt file in the release_docs folder.

Allen


On Monday, July 20, 2015 05:15:56 PM Samer Afach wrote:
> Dear pros:
> 
> I'm trying to compile the HDF5 library to make it compatible with the other
> libraries I'm using in my program. I'm using Visual Studio 2013. What I'm
> doing is that I'm using the build files from this page:
> 
> https://www.hdfgroup.org/HDF5/release/cmakebuild.html
> 
> And then using "build-VS2013-32.bat" to run the build.
> 
> I need visual studio to compile the HDF5 library with the flag /MT, which is
> the multithread, static version of the run-time library in visual studio.
> Although shared libraries are turned off, it doesn't do it. I tried also
> modifying "build-VS2013-32.bat" contents from
> 
> ctest -S HDF518config.cmake,32-VS2013 -C Release -V -O hdf518.log
> 
> to
> 
> ctest -S HDF518config.cmake,32-VS2013 -C Release -V -O hdf518.log
> --enable-parallel --enable-static-exec --disable-shared
> 
> and that doesn't work. I don't see the /MT flag enabled in the library
> settings in the lib folder.
> 
> How can I add this flag to the compilation of HDF5?
> 
> This is very important because all my other libraries (Qt, boost, openssl,
> etc...) are compiled with that. HDF5 is causing a huge linking problem
> without that flag.
> 
> Thank you.
> 
> All the best,
> Samer


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to