diff options
author | Axel Huebl <axel.huebl@plasma.ninja> | 2022-02-14 20:42:58 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-15 15:44:29 (GMT) |
commit | 449f343498b4524a38c3a6fb6b2e9e1753144c5d (patch) | |
tree | f4f8c32ecebdd48c6518f71fa7142ac3a5026157 | |
parent | e5a5f3b76fd89a8e98c981012714f94a1d984ad8 (diff) | |
download | CMake-449f343498b4524a38c3a6fb6b2e9e1753144c5d.zip CMake-449f343498b4524a38c3a6fb6b2e9e1753144c5d.tar.gz CMake-449f343498b4524a38c3a6fb6b2e9e1753144c5d.tar.bz2 |
FindHDF5: Tolerate failure during compiler interrogation
Check that the file that is accessed via `file(STRINGS...)` truly
exists.
This is not the case in some EMSCRIPTEN/WebASM builds where we want to
overwrite the HDF5 find logic manually. The missing check here prevents
that one can overwrite the search logic in exotic environments.
-rw-r--r-- | Modules/FindHDF5.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 9123d56..40ed9a9 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -242,7 +242,7 @@ function(_HDF5_test_regular_compiler_C success version is_parallel) COPY_FILE ${scratch_directory}/compiler_has_h5_c ) endif() - if(${success}) + if(${success} AND EXISTS ${scratch_directory}/compiler_has_h5_c) file(STRINGS ${scratch_directory}/compiler_has_h5_c INFO_STRINGS REGEX "^INFO:" ) @@ -290,7 +290,7 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel) COPY_FILE ${scratch_directory}/compiler_has_h5_cxx ) endif() - if(${success}) + if(${success} AND EXISTS ${scratch_directory}/compiler_has_h5_cxx) file(STRINGS ${scratch_directory}/compiler_has_h5_cxx INFO_STRINGS REGEX "^INFO:" ) |