Fixed bug in FindHDF5 caused by hdf5.h existing without H5pubconf.h.

This commit is contained in:
Will Dicharry 2009-10-29 17:18:41 -04:00
parent 8612aa10b6
commit 518f9c57b7
1 changed files with 8 additions and 7 deletions

View File

@ -291,14 +291,15 @@ else()
# If the HDF5 include directory was found, open H5pubconf.h to determine if # If the HDF5 include directory was found, open H5pubconf.h to determine if
# HDF5 was compiled with parallel IO support # HDF5 was compiled with parallel IO support
set( HDF5_IS_PARALLEL FALSE )
if( HDF5_INCLUDE_DIR ) if( HDF5_INCLUDE_DIR )
file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h" if( EXISTS "${HDF5_INCLUDE_DIR}/h5pubconf.h" )
HDF5_HAVE_PARALLEL_DEFINE file( STRINGS "${HDF5_INCLUDE_DIR}/H5pubconf.h"
REGEX "HAVE_PARALLEL 1" ) HDF5_HAVE_PARALLEL_DEFINE
if( HDF5_HAVE_PARALLEL_DEFINE ) REGEX "HAVE_PARALLEL 1" )
set( HDF5_IS_PARALLEL TRUE ) if( HDF5_HAVE_PARALLEL_DEFINE )
else() set( HDF5_IS_PARALLEL TRUE )
set( HDF5_IS_PARALLEL FALSE ) endif()
endif() endif()
endif() endif()
set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL set( HDF5_IS_PARALLEL ${HDF5_IS_PARALLEL} CACHE BOOL