summaryrefslogtreecommitdiff
path: root/Modules/CheckFortranSourceRuns.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-02-23 21:16:03 +1100
committerCraig Scott <craig.scott@crascit.com>2019-02-23 21:16:03 +1100
commit92d9ec9bfb61d2cd35a82d6906de86c71350b865 (patch)
tree2fa4d622c55f6f6d86d33b2acdeef7754e72bccb /Modules/CheckFortranSourceRuns.cmake
parente6897c72e7c59f7a0b82ed19c1bdb40d42f7adaa (diff)
downloadcmake-92d9ec9bfb61d2cd35a82d6906de86c71350b865.tar.gz
CheckLangSourceRuns: Capture run output to log files
Fixes: #18973
Diffstat (limited to 'Modules/CheckFortranSourceRuns.cmake')
-rw-r--r--Modules/CheckFortranSourceRuns.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
index 13fdb0bedd..a80c13d007 100644
--- a/Modules/CheckFortranSourceRuns.cmake
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -133,7 +133,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
# if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED)
@@ -148,6 +149,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
else()
@@ -163,6 +166,8 @@ macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
endif()