From 518f9c57b71e987a0d8e0f2b172ed660724d34d3 Mon Sep 17 00:00:00 2001 From: Will Dicharry Date: Thu, 29 Oct 2009 17:18:41 -0400 Subject: Fixed bug in FindHDF5 caused by hdf5.h existing without H5pubconf.h. --- Modules/FindHDF5.cmake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 277cbfa..d2092ef 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -291,14 +291,15 @@ else() # If the HDF5 include directory was found, open H5pubconf.h to determine if # HDF5 was compiled with parallel IO support + set( HDF5_IS_PARALLEL FALSE ) if( HDF5_INCLUDE_DIR ) - file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h" - HDF5_HAVE_PARALLEL_DEFINE - REGEX "HAVE_PARALLEL 1" ) - if( HDF5_HAVE_PARALLEL_DEFINE ) - set( HDF5_IS_PARALLEL TRUE ) - else() - set( HDF5_IS_PARALLEL FALSE ) + if( EXISTS "${HDF5_INCLUDE_DIR}/h5pubconf.h" ) + file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h" + HDF5_HAVE_PARALLEL_DEFINE + REGEX "HAVE_PARALLEL 1" ) + if( HDF5_HAVE_PARALLEL_DEFINE ) + set( HDF5_IS_PARALLEL TRUE ) + endif() endif() endif() set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL -- cgit v0.12