summaryrefslogtreecommitdiffstats
path: root/Modules/FindHDF5.cmake
diff options
context:
space:
mode:
authorWill Dicharry <wdicharry@stellarscience.com>2009-10-29 21:18:41 (GMT)
committerWill Dicharry <wdicharry@stellarscience.com>2009-10-29 21:18:41 (GMT)
commit518f9c57b71e987a0d8e0f2b172ed660724d34d3 (patch)
tree959712bcd16882c3a986c6ae5887c894888e107c /Modules/FindHDF5.cmake
parent8612aa10b681fb31bcf3e4959b151fc7f3a5442e (diff)
downloadCMake-518f9c57b71e987a0d8e0f2b172ed660724d34d3.zip
CMake-518f9c57b71e987a0d8e0f2b172ed660724d34d3.tar.gz
CMake-518f9c57b71e987a0d8e0f2b172ed660724d34d3.tar.bz2
Fixed bug in FindHDF5 caused by hdf5.h existing without H5pubconf.h.
Diffstat (limited to 'Modules/FindHDF5.cmake')
-rw-r--r--Modules/FindHDF5.cmake15
1 files 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