summaryrefslogtreecommitdiffstats
path: root/Tests/FortranOnly
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-18 19:33:39 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-18 21:40:19 (GMT)
commit95976514f605e83c4db5e1dd176398653b0d42cd (patch)
tree2224ace15f0f84096ecc1fd941e4373003e5ceda /Tests/FortranOnly
parent20bbd5f3d3b63fcf1f62e1df3ec8ce3ba30d288b (diff)
downloadCMake-95976514f605e83c4db5e1dd176398653b0d42cd.zip
CMake-95976514f605e83c4db5e1dd176398653b0d42cd.tar.gz
CMake-95976514f605e83c4db5e1dd176398653b0d42cd.tar.bz2
Tests: Avoid using CMake{Output,Error}.log files
These log files will soon go away, so avoid using them in tests.
Diffstat (limited to 'Tests/FortranOnly')
-rw-r--r--Tests/FortranOnly/CMakeLists.txt22
1 files changed, 17 insertions, 5 deletions
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index b07c214..fc71a18 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -56,8 +56,6 @@ add_custom_target(checksayhello ALL
)
add_dependencies(checksayhello sayhello)
-set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log)
-file(REMOVE "${err_log}")
include(CheckFortranSourceCompiles)
unset(HAVE_PRINT CACHE)
CHECK_Fortran_SOURCE_COMPILES([[
@@ -66,10 +64,24 @@ CHECK_Fortran_SOURCE_COMPILES([[
END
]] HAVE_PRINT)
if(NOT HAVE_PRINT)
- if(EXISTS "${err_log}")
- file(READ "${err_log}" err)
+ set(configure_log "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeConfigureLog.yaml")
+ if(EXISTS "${configure_log}")
+ file(READ "${configure_log}" log_content)
+ else()
+ set(log_content "")
+ endif()
+ if(log_content MATCHES [[( -
+ kind: "try_compile-v1"(
++ [^
+]+)+
+ checks:
+ - "Performing Test HAVE_PRINT"(
++ [^
+]+)+)]])
+ set(err "${CMAKE_MATCH_1}")
+ else()
+ set(err "")
endif()
- string(REPLACE "\n" "\n " err " ${err}")
message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n"
"${err}")
endif()