summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/install/DIRECTORY-PATTERN.cmake
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2018-07-12 14:04:37 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2018-07-17 13:07:01 (GMT)
commit4108ab4be2307ef161467de46e4c35e8b086ce02 (patch)
tree44f01307bf9efbc4d08e56dc27149c19bc31e2b6 /Tests/RunCMake/install/DIRECTORY-PATTERN.cmake
parentbce8fa229ad7ea1c05e0206ed0c5bafe5fc32e2f (diff)
downloadCMake-4108ab4be2307ef161467de46e4c35e8b086ce02.zip
CMake-4108ab4be2307ef161467de46e4c35e8b086ce02.tar.gz
CMake-4108ab4be2307ef161467de46e4c35e8b086ce02.tar.bz2
Tests: Add test for install(DIRECTORY) with PATTERN and REGEX
Diffstat (limited to 'Tests/RunCMake/install/DIRECTORY-PATTERN.cmake')
-rw-r--r--Tests/RunCMake/install/DIRECTORY-PATTERN.cmake36
1 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN.cmake b/Tests/RunCMake/install/DIRECTORY-PATTERN.cmake
new file mode 100644
index 0000000..74d8043
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-PATTERN.cmake
@@ -0,0 +1,36 @@
+install(
+ DIRECTORY pattern/
+ DESTINATION dir1
+ FILES_MATCHING
+ PATTERN "*.h"
+ REGEX "\\.c$"
+ )
+
+# FIXME: If/when CMake gains a good way to read file permissions, we should
+# check that these permissions were set correctly.
+install(
+ DIRECTORY pattern
+ DESTINATION dir2
+ FILE_PERMISSIONS OWNER_READ OWNER_WRITE
+ DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ PATTERN "*.h" EXCLUDE
+ REGEX "\\.c$" EXCLUDE
+ )
+
+install(
+ DIRECTORY pattern/
+ DESTINATION dir3
+ PATTERN "*.h"
+ PERMISSIONS OWNER_READ OWNER_WRITE
+ )
+
+install(
+ DIRECTORY pattern/
+ DESTINATION dir4
+ USE_SOURCE_PERMISSIONS
+ )
+
+install(
+ DIRECTORY
+ DESTINATION empty
+ )