From acbd69c219214ed2477e33d1bb0c7754513e03d5 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Mon, 4 Feb 2019 21:07:25 -0500 Subject: FindHDF5: Use execute_process instead of exec_program --- Modules/FindHDF5.cmake | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 2772b7de58..ff464d7362 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -322,20 +322,22 @@ macro( _HDF5_invoke_compiler language output return_value version is_parallel) elseif("${language}" STREQUAL "Fortran") set(test_file ${scratch_dir}/cmake_hdf5_test.f90) endif() - exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE} - ARGS -show ${lib_type_args} ${test_file} - OUTPUT_VARIABLE ${output} - RETURN_VALUE ${return_value} - ) + execute_process( + COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file} + OUTPUT_VARIABLE ${output} + ERROR_VARIABLE ${output} + RESULT_VARIABLE ${return_value} + ) if(NOT ${${return_value}} EQUAL 0) message(STATUS "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") endif() - exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE} - ARGS -showconfig - OUTPUT_VARIABLE config_output - RETURN_VALUE config_return - ) + execute_process( + COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig + OUTPUT_VARIABLE config_output + ERROR_VARIABLE config_output + RESULT_VARIABLE config_return + ) if(NOT ${return_value} EQUAL 0) message( STATUS "Unable to determine HDF5 ${language} version from HDF5 wrapper.") -- cgit v1.2.1