From f6ed2585e595305d4866e4128bf98e9236b6ecd2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Jan 2023 14:41:19 -0500 Subject: Modules: Record system inspection steps in the configure log Replace old-style `file(APPEND .../CMake{Output,Error}.log)` logging with calls to `message(CONFIGURE_LOG)` to record the steps in the `CMakeConfigureLog.yaml` configure log instead. Issue: #23200 --- Modules/CMakeDetermineCUDACompiler.cmake | 12 +++---- Modules/CMakeDetermineCompilerABI.cmake | 8 ++--- Modules/CMakeDetermineCompilerId.cmake | 39 +++++++++++++--------- Modules/CMakeDetermineFortranCompiler.cmake | 4 +-- Modules/CMakeDetermineSystem.cmake | 13 ++++---- Modules/CMakeTestCUDACompiler.cmake | 2 +- Modules/CheckLanguage.cmake | 4 +-- Modules/Compiler/NAG-Fortran.cmake | 4 +-- Modules/FindOpenMP.cmake | 8 ++--- .../Internal/CMakeTryCompilerOrLinkerFlag.cmake | 4 +-- Modules/Platform/Android-Determine.cmake | 4 +-- Tests/RunCMake/Configure/ErrorLogs-stderr.txt | 4 +-- Tests/RunCMake/Configure/ErrorLogs.cmake | 2 ++ Tests/RunCMake/try_compile/ConfigureLog-config.txt | 18 ++++++++-- Tests/RunCMake/try_compile/Inspect-config.txt | 27 +++++++++++++-- .../try_compile/SourceFromBadName-config.txt | 12 ++++++- Tests/RunCMake/try_run/ConfigureLog-config.txt | 18 ++++++++-- 17 files changed, 126 insertions(+), 57 deletions(-) diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake index f43b17b..53c5f78 100644 --- a/Modules/CMakeDetermineCUDACompiler.cmake +++ b/Modules/CMakeDetermineCUDACompiler.cmake @@ -520,10 +520,10 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") set(_SET_CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT \"${CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT}\")") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed CUDA nvcc implicit link information from above output:\n${_nvcc_log}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed CUDA nvcc implicit link information:\n${_nvcc_log}\n${log}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Failed to parse CUDA nvcc implicit link information:\n${_nvcc_log}\n\n") message(FATAL_ERROR "Failed to extract nvcc implicit link line.") endif() @@ -576,10 +576,10 @@ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") list(APPEND CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "${line}") endforeach() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed CUDA nvcc include information from above output:\n${_nvcc_log}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed CUDA nvcc include information:\n${_nvcc_log}\n${log}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Failed to detect CUDA nvcc include information:\n${_nvcc_log}\n\n") endif() diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake index 1e28f65..4169734 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -124,8 +124,8 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) set (implicit_incdirs "") cmake_parse_implicit_include_info("${OUTPUT}" "${lang}" implicit_incdirs log rv) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${lang} implicit include dir info from above output: rv=${rv}\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed ${lang} implicit include dir info: rv=${rv}\n${log}\n\n") if("${rv}" STREQUAL "done") # Entries that we have been told to explicitly pass as standard include # directories will not be implicitly added by the compiler. @@ -149,8 +149,8 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}" COMPUTE_IMPLICIT_OBJECTS implicit_objs LANGUAGE ${lang}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${lang} implicit link information from above output:\n${log}\n\n") + message(CONFIGURE_LOG + "Parsed ${lang} implicit link information:\n${log}\n\n") endif() # for VS IDE Intel Fortran we have to figure out the # implicit link path for the fortran run time using diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 8eec8f5..ece9f39 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -2,6 +2,8 @@ # file Copyright.txt or https://cmake.org/licensing for details. macro(__determine_compiler_id_test testflags_var userflags_var) + set(_CMAKE_${lang}_COMPILER_ID_LOG "") + separate_arguments(testflags UNIX_COMMAND "${${testflags_var}}") CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${testflags}" "${${userflags_var}}" "${src}") CMAKE_DETERMINE_COMPILER_ID_MATCH_VENDOR("${lang}" "${COMPILER_${lang}_PRODUCED_OUTPUT}") @@ -11,6 +13,9 @@ macro(__determine_compiler_id_test testflags_var userflags_var) CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}") endforeach() endif() + + message(CONFIGURE_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}") + unset(_CMAKE_${lang}_COMPILER_ID_LOG) endmacro() # Function to compile a source file to identify the compiler. This is @@ -114,7 +119,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" -version\n" "${output}\n" ) @@ -138,7 +143,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" -version\n" "${output}\n" ) @@ -158,7 +163,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) RESULT_VARIABLE result TIMEOUT 10 ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Running the ${lang} compiler: \"${CMAKE_${lang}_COMPILER}\" --version\n" "${output}\n" ) @@ -732,7 +737,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} ") # Log the output unless we recognize it as a known-bad case. if(NOT CMAKE_${lang}_COMPILER_ID_OUTPUT MATCHES "warning #5117: Bad # preprocessor line") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "${MSG}") endif() string(APPEND _CMAKE_DETERMINE_COMPILER_ID_BUILD_MSG "${MSG}") @@ -752,7 +757,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} set(COMPILER_${lang}_PRODUCED_OUTPUT) else() # Compilation succeeded. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compiling the ${lang} compiler identification source file \"${src}\" succeeded. ${COMPILER_DESCRIPTION} The output was: @@ -781,7 +786,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} foreach(file ${files}) if(NOT IS_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}/${file}) list(APPEND COMPILER_${lang}_PRODUCED_FILES ${file}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compilation of the ${lang} compiler identification source \"" "${src}\" produced \"${file}\"\n\n") endif() @@ -789,7 +794,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} if(NOT COMPILER_${lang}_PRODUCED_FILES) # No executable was found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG "Compilation of the ${lang} compiler identification source \"" "${src}\" did not produce an executable in \"" "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n") @@ -801,6 +806,7 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT} # Return the files produced by the compilation. set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE) set(COMPILER_${lang}_PRODUCED_OUTPUT "${COMPILER_${lang}_PRODUCED_OUTPUT}" PARENT_SCOPE) + set(_CMAKE_${lang}_COMPILER_ID_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}" PARENT_SCOPE) endfunction() @@ -994,15 +1000,16 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) # Check the compiler identification string. if(CMAKE_${lang}_COMPILER_ID) # The compiler identification was found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \"" - "${file}\"\n\n") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG + "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in:\n" + " ${file}\n\n") else() # The compiler identification could not be found. - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "The ${lang} compiler identification could not be found in \"" - "${file}\"\n\n") + string(APPEND _CMAKE_${lang}_COMPILER_ID_LOG + "The ${lang} compiler identification could not be found in:\n" + " ${file}\n\n") endif() + set(_CMAKE_${lang}_COMPILER_ID_LOG "${_CMAKE_${lang}_COMPILER_ID_LOG}" PARENT_SCOPE) endif() # try to figure out the executable format: ELF, COFF, Mach-O @@ -1089,7 +1096,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang userflags) ) if("${output}" MATCHES "${regex}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "matched \"${regex}\":\n${output}") set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE) @@ -1098,11 +1105,11 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang userflags) break() else() if("${result}" MATCHES "timeout") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "terminated after 10 s due to timeout.") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "did not match \"${regex}\":\n${output}") endif() diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index d169012..8cbaf70 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -187,11 +187,11 @@ if(NOT CMAKE_Fortran_COMPILER_ID_RUN) if(NOT CMAKE_COMPILER_RETURN) if(CMAKE_COMPILER_OUTPUT MATCHES "THIS_IS_GNU") set(CMAKE_Fortran_COMPILER_ID "GNU") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining if the Fortran compiler is GNU succeeded with " "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining if the Fortran compiler is GNU failed with " "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") endif() diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 94e92e8..d4dcc62 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -196,13 +196,14 @@ endif() if(CMAKE_BINARY_DIR) # write entry to the log file if(PRESET_CMAKE_SYSTEM_NAME) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n") + message(CONFIGURE_LOG + "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n" + "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n" + ) else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") + message(CONFIGURE_LOG + "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n" + ) endif() # if a toolchain file is used, it needs to be included in the configured file, diff --git a/Modules/CMakeTestCUDACompiler.cmake b/Modules/CMakeTestCUDACompiler.cmake index 6c53329..5779e4b 100644 --- a/Modules/CMakeTestCUDACompiler.cmake +++ b/Modules/CMakeTestCUDACompiler.cmake @@ -60,7 +60,7 @@ if(CMAKE_CUDA_ABI_COMPILED) set(_CUDA_ARCHS_STATUS "") endif() string(REPLACE "\n" "\n " _CUDA_ARCHS_OUTPUT " ${_CUDA_ARCHS_OUTPUT}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Detecting the CUDA native architecture(s) failed with " "the following output:\n${_CUDA_ARCHS_OUTPUT}\n\n") endif() diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 52f707c..2e56a19 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -90,14 +90,14 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" ) include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/result.cmake OPTIONAL) if(CMAKE_${lang}_COMPILER AND "${_cl_result}" STREQUAL "0") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "${_desc} passed with the following output:\n" "${_cl_output}\n") set(_CHECK_COMPILER_STATUS CHECK_PASS) else() set(CMAKE_${lang}_COMPILER NOTFOUND) set(_CHECK_COMPILER_STATUS CHECK_FAIL) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "${_desc} failed with the following output:\n" "${_cl_output}\n") endif() diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index a65fd2c..b946cfd 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -14,7 +14,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}") string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}") set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Detecting NAG Fortran directory with -dryrun found\n" " object: ${_nag_obj}\n" " directory: ${_nag_dir}\n" @@ -22,7 +22,7 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) "from output:\n${_dryrun}\n\n") message(CHECK_PASS "${_nag_dir}") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n") message(CHECK_FAIL "failed") endif() diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake index f1d70a5..4aa7d91 100644 --- a/Modules/FindOpenMP.cmake +++ b/Modules/FindOpenMP.cmake @@ -238,9 +238,6 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) LANGUAGE ${LANG} ) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Parsed ${LANG} OpenMP implicit link information from above output:\n${OpenMP_${LANG}_LOG_VAR}\n\n") - # For LCC we should additionally alanyze -print-search-dirs output # to check for additional implicit_dirs. # Note: This won't work if CMP0129 policy is set to OLD! @@ -253,11 +250,14 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_VAR OPENMP_LIB_NAMES_VAR) if("${output_lines}" MATCHES ".*\nlibraries:[ \t]+(.*:)\n.*") string(REPLACE ":" ";" implicit_dirs_addon "${CMAKE_MATCH_1}") list(PREPEND OpenMP_${LANG}_IMPLICIT_LINK_DIRS ${implicit_dirs_addon}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + string(APPEND OpenMP_${LANG}_LOG_VAR " Extended OpenMP library search paths: [${implicit_dirs}]\n") endif() endif() + message(CONFIGURE_LOG + "Parsed ${LANG} OpenMP implicit link information from above output:\n${OpenMP_${LANG}_LOG_VAR}\n\n") + unset(_OPENMP_LIB_NAMES) foreach(_OPENMP_IMPLICIT_LIB IN LISTS OpenMP_${LANG}_IMPLICIT_LIBRARIES) get_filename_component(_OPENMP_IMPLICIT_LIB_DIR "${_OPENMP_IMPLICIT_LIB}" DIRECTORY) diff --git a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake index d6fa5f0..b671b4a 100644 --- a/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake +++ b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake @@ -51,7 +51,7 @@ function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result) if (NOT lang MATCHES "^(C|CXX|Fortran|ASM)$") # other possible languages are not supported # log message to keep trace of this problem... - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Function 'CMAKE_CHECK_COMPILER_FLAG' called with unsupported language: ${lang}\n") set(${result} FALSE CACHE INTERNAL ${comment}) return() @@ -144,7 +144,7 @@ function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result) endforeach() endif() if (DEFINED ${result}) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Determining if the ${flag} option " "is supported for ${lang} language failed with the following output:\n" "${COMPILER_FLAG_OUTPUT}\n") diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index a4e9574..715f68b 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -70,7 +70,7 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio") endif() endif() if(VCXPROJ_INSPECT_RESULT) - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + message(CONFIGURE_LOG "Determining the sysroot for the Android NDK failed. The output was: ${VCXPROJ_INSPECT_RESULT} @@ -78,7 +78,7 @@ ${VCXPROJ_INSPECT_OUTPUT} ") else() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + message(CONFIGURE_LOG "Determining the sysroot for the Android NDK succeeded. The output was: ${VCXPROJ_INSPECT_RESULT} diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt index 4eee45d..ec8c8c2 100644 --- a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt +++ b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at ErrorLogs.cmake:3 \(message\): +CMake Error at ErrorLogs.cmake:[0-9]+ \(message\): Some error! Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake index e8cf062..3a9d107 100644 --- a/Tests/RunCMake/Configure/ErrorLogs.cmake +++ b/Tests/RunCMake/Configure/ErrorLogs.cmake @@ -1,3 +1,5 @@ +file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Some detailed output information!\n") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "Some detailed error information!\n") message(SEND_ERROR "Some error!") diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt index 262ed3c..1f848bf 100644 --- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -17,7 +24,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* - kind: "try_compile-v1" backtrace: diff --git a/Tests/RunCMake/try_compile/Inspect-config.txt b/Tests/RunCMake/try_compile/Inspect-config.txt index e09fe55..7a39335 100644 --- a/Tests/RunCMake/try_compile/Inspect-config.txt +++ b/Tests/RunCMake/try_compile/Inspect-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -17,7 +24,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -34,5 +48,12 @@ events: variable: "CMAKE_CXX_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* \.\.\.$ diff --git a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt index 10f3293..cb76565 100644 --- a/Tests/RunCMake/try_compile/SourceFromBadName-config.txt +++ b/Tests/RunCMake/try_compile/SourceFromBadName-config.txt @@ -1 +1,11 @@ -^$ +^ +--- +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ +\.\.\.$ diff --git a/Tests/RunCMake/try_run/ConfigureLog-config.txt b/Tests/RunCMake/try_run/ConfigureLog-config.txt index ba396e0..bf3c3bd 100644 --- a/Tests/RunCMake/try_run/ConfigureLog-config.txt +++ b/Tests/RunCMake/try_run/ConfigureLog-config.txt @@ -1,6 +1,13 @@ ^ --- -events: +events:( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)+ - kind: "try_compile-v1" backtrace: @@ -16,7 +23,14 @@ events: variable: "CMAKE_C_ABI_COMPILED" cached: true stdout: \|.* - exitCode: 0 + exitCode: 0( + - + kind: "message-v1" + backtrace:( + - "[^"]+")+ + message: \|( ++ [^ +]*)*)* - kind: "try_run-v1" backtrace: -- cgit v0.12