summaryrefslogtreecommitdiff
path: root/Tests/StringFileTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-04-29 13:13:29 -0400
committerBrad King <brad.king@kitware.com>2009-04-29 13:13:29 -0400
commitc58ca242865118d65b5add11a256832d177afe6d (patch)
tree13d42b24914dc0aa987c10bc2c4bf9df6bfcfef6 /Tests/StringFileTest
parentb6cb11734686eebb7ddbd97b92eaaa5174954667 (diff)
downloadcmake-c58ca242865118d65b5add11a256832d177afe6d.tar.gz
ENH: Create file(COPY) command signature
The file(INSTALL) command has long been undocumented and used only to implement install() scripts. We now document it and provide a similar file(COPY) signature which is useful in general-purpose scripts. It provides the capabilities of install(DIRECTORY) and install(FILES) but operates immediately instead of contributing to install scripts.
Diffstat (limited to 'Tests/StringFileTest')
-rw-r--r--Tests/StringFileTest/CMakeLists.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index b50d203252..398243cabf 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -188,10 +188,19 @@ 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 copy with relative paths
+FILE(COPY .
+ DESTINATION src
+ FILE_PERMISSIONS OWNER_READ OWNER_WRITE
+ DIRECTORY_PERMISSIONS OWNER_READ OWNER_EXECUTE # test no OWNER_WRITE
+ FILES_MATCHING PATTERN *.cxx # Only copy the main source file
+ REGEX /src$ EXCLUDE # Block recursion for in-source build
+ )
+
# Test file glob
FILE(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*")
MESSAGE("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}")
-SET(expr "${CMAKE_CURRENT_SOURCE_DIR}/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx")
+SET(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx")
MESSAGE("Glob expression is [${expr}].")
FILE(GLOB src_files "${expr}")
MESSAGE("Globbed files [${src_files}].")