summaryrefslogtreecommitdiffstats
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-04-15 13:58:13 (GMT)
committerBrad King <brad.king@kitware.com>2009-04-15 13:58:13 (GMT)
commit0d92350bb67de4632220e63d8f02c062596896d1 (patch)
tree131bd18d053f4c770a85dd417f9ecdec43a97f74 /Tests/StringFileTest
parentd3363beb2f5b4bedee95aae6f6697f059ed3f48b (diff)
downloadCMake-0d92350bb67de4632220e63d8f02c062596896d1.zip
CMake-0d92350bb67de4632220e63d8f02c062596896d1.tar.gz
CMake-0d92350bb67de4632220e63d8f02c062596896d1.tar.bz2
ENH: Create file(RENAME) command mode
This creates command "file(RENAME <oldname> <newname>)" to rename a file or directory within a single disk volume.
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index f2789e6..b50d203 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -184,7 +184,9 @@ SET(infile "${infile+-/out}")
# Write include file to a file
STRING(REGEX REPLACE "includefile" "${file}" outfile "${infile}")
-FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h" "${outfile}")
+FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}")
+FILE(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp"
+ "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h")
# Test file glob
FILE(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*")