From ee075a53c883775e8753e0fe6ba240eba9dcaae6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 27 Mar 2023 13:58:51 -0400 Subject: FindHDF5: Record compiler wrapper checks to configure log --- Modules/FindHDF5.cmake | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index c1e6a64..a44c6f9 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -356,9 +356,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var ERROR_VARIABLE output RESULT_VARIABLE return_value ) - if(return_value AND NOT HDF5_FIND_QUIETLY) - message(STATUS - "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.") + if(NOT return_value EQUAL 0) + message(CONFIGURE_LOG + "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.\n\n${output}") + if(NOT HDF5_FIND_QUIETLY) + message(STATUS + "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.") + endif() else() execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} "${_HDF5_TEST_SRC}" @@ -368,9 +372,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value AND NOT HDF5_FIND_QUIETLY) - message(STATUS - "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") + if(NOT return_value EQUAL 0) + message(CONFIGURE_LOG + "Unable to determine HDF5 ${language} flags from HDF5 wrapper.\n\n${output}") + if(NOT HDF5_FIND_QUIETLY) + message(STATUS + "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") + endif() endif() execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig @@ -379,9 +387,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var RESULT_VARIABLE return_value OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(return_value AND NOT HDF5_FIND_QUIETLY) - message(STATUS - "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.") + if(NOT return_value EQUAL 0) + message(CONFIGURE_LOG + "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.\n\n${output}") + if(NOT HDF5_FIND_QUIETLY) + message(STATUS + "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.") + endif() endif() string(REGEX MATCH "HDF5 Version: ([a-zA-Z0-9\\.\\-]*)" version "${config_output}") if(version) -- cgit v0.12