mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 22:58:37 -05:00
9bf40d8027
Add a `NO_REPLACE` option that prevents overwriting `<newname>` if it exists.
6 lines
207 B
CMake
6 lines
207 B
CMake
set(oldname "${CMAKE_CURRENT_BINARY_DIR}/input")
|
|
set(newname "${CMAKE_CURRENT_BINARY_DIR}/output")
|
|
file(WRITE "${oldname}" "a")
|
|
file(WRITE "${newname}" "b")
|
|
file(RENAME "${oldname}" "${newname}" NO_REPLACE)
|