cmake: always replace wrapped file output

This fixes an issue when the source's timestamp became newer than the
output's but the output itself didn't change.  The script would get invoked,
but since the output matched the previous output it didn't update the
output's timestamp to be newer than the source - leading to the script
running again the next time.

The add_custom_target that invokes this script already takes care of not
rebuilding the output if the source didn't change.

Signed-off-by: Josef 'Jeff' Sipek <>
1 files changed, 1 insertions(+), 3 deletions(-)

M cmake/wrap-script.cmake
M cmake/wrap-script.cmake +1 -3
@@ 40,6 40,4 @@ set(out "/* ${DST} - Generated by cmake.
 file(WRITE "${DST}.tmp" ${out})
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
-	"${DST}.tmp" "${DST}")
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove "${DST}.tmp")
+execute_process(COMMAND ${CMAKE_COMMAND} -E rename "${DST}.tmp" "${DST}")