Modules: Tolerate CMAKE_EXECUTE_PROCESS_COMMAND_ERROR_IS_FATAL

Capture `execute_process` calls' `RESULT_VARIABLE`.

We don't actually need to check the result as we presume the existing
logic is already adequate, and sometimes programs return non-zero values
as result of valid query.  I.e. this is a "safe" way to broadly protect
these scripts.

Issue: #27782
This commit is contained in:
scivision
2026-05-07 09:26:47 -04:00
parent 46410ea189
commit 7406f0be82
39 changed files with 144 additions and 51 deletions

View File

@@ -483,7 +483,10 @@ extern \"C\" {
file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${_filenameTmp}" "${_filename}"
OUTPUT_QUIET ERROR_QUIET
RESULT_VARIABLE _result_copy)
endfunction()