Thanks to JC of Kitware at SciPy 2014, the situation with CMake and HDF5 on windows has greatly improved.

First, there's been a new release of HDF5 (1.8.13). This release removes a buggy CMake library finder (targets) file. The improperly generated file in HDF5 1.8.12 was thehdf5-targets-release.cmake file. Go get the new release now:

Secondly, there is a bug in CMake's builtin script for finding HDF5. On Windows, it finds a DLL before the Lib file, and won't link properly ( Thanks to JC, I understand that the way forward is not to patch that file, but ratherto move towards removing CMake's builtin scripts entirely, and push the responsibility of finding these libraries out to the library authors. Several library authors have already done this (including HDF5, thankfully). The included FindSomething.cmake scripts should be treated as a legacy, fallback approach. CMake has a great option for forcing the use of the library's scripts for defining libraries and headers. When calling the find_package function, you need to specify the NO_MODULE argument, like so:


This bypasses much of CMake's internal FindHDF5 script, and instead goes looking for hdf5-config.cmake in several locations, ideally finding it in the place we installed the HDF5 libraries. The new version of the HDF5 libraries now properly tells CMake where to find everything, and life is peachy.


In summary, use NO_MODULE when the library you're using provides a -config.cmake file. It will likely be better (more current) than CMake's internal Findsomething.cmake file. However, be careful! If not all platforms actually provide this file, then your build will break where this file does not exist. Notably, Ubuntu does not (currently) ship the hdf5-config.cmake files with the libhdf5-dev package. So, you'll need a code section like this (based on

# back up any user-defined HDF5_DIR setting
FIND_PACKAGE(HDF5 "1.8.5" NO_MODULE) # First look for hdf5-config.cmake in defined locations. This file is generated by HDF5 team and is likely more up to date than FindHDF5.cmake included in CMake.
 # didn't find hdf5-config.cmake. Need to fall back on CMake's built-in FindHDF5.cmake logic.
 # required says we fail if it isn't found.
 # Restore the value reset by the previous call to 'find_package(HDF5 "1.8.5" NO_MODULE)'
 set(HDF5_DIR ${_SAVED_HDF5_DIR} CACHE PATH "HDF5 install dir" FORCE)


More information:
details on find_package:
Creating your own package descriptions to make includes and libraries easy for downstream users:

Thanks again to JC for helping me figure this stuff out - now I need to get QSTEM using it!