[CMake] FindHDF5.cmake improvement proposal

Antonio Valentino antonio.valentino at tiscali.it
Sun Mar 7 02:38:55 EST 2010


Hi Will,

Il giorno Tue, 02 Mar 2010 09:07:48 -0700
Will Dicharry <wdicharry at stellarscience.com> ha scritto:

> Antonio Valentino wrote:
> > Hi list,
> > pasted below a snippet I use in a project of mine to handle HDF5
> > library.
> > The purpose is to improve detection of required library zlib and
> > szip in cases when the HDF5_C_COMPILER_EXECUTABLE is not available
> > e.g. when one try to use pre-build HDF5 libraries on win32.
> > The snippet also adds an option (WIN32 only) to set defines
> > required by HDF5 dlls. This part could be further automated with
> > some regexp (i suppose).
> > 
> > I'm not a cmake expert so I would like to receive some comment by
> > users more expert than me.
> > If the approach is correct I could try to submit a patch that
> > integrates the snippet in the FindHDF5.cmake module.
> 
> Hi Antonio,
> 
> I'm the maintainer of the FindHDF5 module, and I think your additions 
> would be useful when the wrapper compiler is not found (or if you
> happen to be on Windows, as much of the command line stripping code
> won't work there). 


please find attached the modified version of FindHDF5.cmake that
includes:

* improved logic for detecting zlib and szib dependencies when the
  wrapper compiler is not available
* code for setting windows specific defines for using DLLs when the
  wrapper compiler is not available
* code for setting component specific libraries
  (HDF5_${LANGUAGE}_LIBRARIES). The variable was always empty in the
  previous version
 
Please note that the modified module depends on Michael
Jackson's FindSZIP.cmake module available at

http://gitorious.org/hdf5/hdf5-v18/blobs/master/Resources/CMake/FindSZIP.cmake

If you like I could file a new ticket on the bug tracker.

best regards

-- 
Antonio Valentino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindHDF5.cmake
Type: text/x-cmake
Size: 16737 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100307/1f26b743/attachment-0001.bin>


More information about the CMake mailing list