From 2439a048b0b98b654d6b4a68146eb65283c575e8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 Jan 2021 14:04:25 -0500 Subject: FindHDF5: avoid writing to the output when testing h5cc The execution of this tool can output error logs to the output during configure. This can then be caught by CTest and flagged as an error during the build. --- Modules/FindHDF5.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 25f5a1f..6bbc821 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -360,6 +360,8 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file} WORKING_DIRECTORY ${scratch_dir} + OUTPUT_VARIABLE output + ERROR_VARIABLE output RESULT_VARIABLE return_value ) if(return_value) -- cgit v0.12 From b9246693857b26e24e5a46e88698ff87c52e83fa Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 Jan 2021 14:05:14 -0500 Subject: FindHDF5: silence STATUS messages when found with QUIET --- Modules/FindHDF5.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 6bbc821..38388d9 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -364,7 +364,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var ERROR_VARIABLE output RESULT_VARIABLE return_value ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.") else() @@ -376,7 +376,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") endif() @@ -387,7 +387,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value) + if(return_value AND NOT HDF5_FIND_QUIETLY) message(STATUS "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.") endif() -- cgit v0.12