Skip to content
Snippets Groups Projects
Commit be6267ed authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

SuperBuild: if there is no args to patch, use -ut

parent ef6e84bc
No related branches found
No related tags found
No related merge requests found
......@@ -7,19 +7,23 @@ endif()
separate_arguments(DOT_DIFF_FILES)
list(SORT DOT_DIFF_FILES)
if(NOT PATCH_ARGS)
set(PATCH_ARGS "-ut")
endif()
foreach(dot_diff_file ${DOT_DIFF_FILES})
message("Input patch file: ${dot_diff_file}")
execute_process(
COMMAND
${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}
${PATCH_PROGRAM} "-p1" "-i" "${dot_diff_file}" "${PATCH_ARGS}"
${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}
${PATCH_PROGRAM} "${PATCH_ARGS}" "-p1" "-i" "${dot_diff_file}"
RESULT_VARIABLE patch_rv
OUTPUT_VARIABLE patch_ov
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
set(PATCHING_FAILED FALSE)
if(NOT "${patch_rv}" STREQUAL "0")
if( NOT "${patch_ov}" MATCHES "previously applied")
set(PATCHING_FAILED TRUE)
......@@ -29,14 +33,13 @@ foreach(dot_diff_file ${DOT_DIFF_FILES})
if( "${patch_ov}" MATCHES "FAILED")
set(PATCHING_FAILED TRUE)
endif()
if(PATCHING_FAILED)
message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status \n ${patch_ov} \n")
else()
message("${patch_ov}")
message("${patch_ov}")
endif()
unset(patch_rv)
unset(patch_ov)
endforeach()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment