# This extends CMake's FindHDF5.cmake to add support to include MPI include
# paths and libraries in the HDF5 ones if HDF5_IS_PARALLEL is ON
# (BUG #0014363).

# include the default FindHDF5.cmake.
include(${CMAKE_ROOT}/Modules/FindHDF5.cmake)

if(HDF5_FOUND AND HDF5_IS_PARALLEL)
  include(vtkMPI)
  if(MPI_C_INCLUDE_PATH)
    list(APPEND HDF5_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH})
  endif()
  if(MPI_C_LIBRARIES)
    list(APPEND HDF5_LIBRARIES ${MPI_C_LIBRARIES})
  endif()
endif()

# This extends CMake's FindHDF5.cmake to add support to include MPI include
# paths and libraries in the HDF5 ones if HDF5_IS_PARALLEL is ON
# (BUG #0014363).

# include the default FindHDF5.cmake.
include(${CMAKE_ROOT}/Modules/FindHDF5.cmake)

if(HDF5_FOUND AND (HDF5_IS_PARALLEL OR HDF5_ENABLE_PARALLEL))
  include(vtkMPI)
  if(MPI_C_INCLUDE_PATH)
    list(APPEND HDF5_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH})
  endif()
  if(MPI_C_LIBRARIES)
    list(APPEND HDF5_LIBRARIES ${MPI_C_LIBRARIES})
  endif()
endif()

Fix issue with external HDF5
Fix issue with external HDF5

In certain cases HDF5 sets HDF5_IS_PARALLEL flag and in other cases sets
HDF5_ENABLE_PARALLEL flag. Updated the logic to check for both.

Change-Id: If923d82d9cfbd40ea05322305d5790438e98ed4e
