  
  IF (WIN32 AND NOT UNIX)
 -  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_" CACHE STRING "HDF5 defintions")
-+  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_ -DH5_BUILT_AS_DYNAMIC_LIB" CACHE STRING "HDF5 defintions")
++  SET(HDF5_DEFINITIONS "-D_HDF5USEDLL_;-DH5_BUILT_AS_DYNAMIC_LIB" CACHE STRING "HDF5 defintions")
  ENDIF (WIN32 AND NOT UNIX)
  
  

===================================================================
--- src/alps/CMakeLists.txt	(revision 7814)
+++ src/alps/CMakeLists.txt	(working copy)
@@ -102,11 +102,16 @@
 endif (Boost_FOUND)
 
 if(BUILD_SHARED_LIBS)
-  set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS}")
+  if(HDF5_DEFINITIONS)
+    set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS} ${HDF5_DEFINITIONS}")
+  else(HDF5_DEFINITIONS)
+    set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_SHARED_CPPFLAGS}")
+  endif(HDF5_DEFINITIONS)
 else(BUILD_SHARED_LIBS)
   set_target_properties(alps PROPERTIES COMPILE_DEFINITIONS "${ALPS_STATIC_CPPFLAGS}")
 endif(BUILD_SHARED_LIBS)

===================================================================
--- applications/dmrg/tebd/CMakeLists.txt	(revision 7814)
+++ applications/dmrg/tebd/CMakeLists.txt	(working copy)
@@ -11,6 +11,13 @@
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LAPACK_LINKER_FLAGS}")
   add_executable(tebd ${SOURCES})
   target_link_libraries(tebd ${HDF5_STATIC_LIBRARIES} ${HDF5_LIBRARIES} ${LAPACK_LIBRARY} ${BLAS_LIBRARY})
+  if(HDF5_DEFINITIONS)
+    foreach (_hdf5_def ${HDF5_DEFINITIONS})
+      string(REPLACE "-D" "" _escaped_def ${_hdf5_def})
+      list(APPEND ALPS_TEBD_DEFINITIONS ${_escaped_def})
+    endforeach(_hdf5_def)
+    set_target_properties(tebd PROPERTIES COMPILE_DEFINITIONS "${ALPS_TEBD_DEFINITIONS}")
+  endif(HDF5_DEFINITIONS)
   install(TARGETS tebd RUNTIME DESTINATION bin COMPONENT applications)
 else(LAPACK_FOUND AND ALPS_BUILD_FORTRAN)
