summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
diff options
context:
space:
mode:
authorAsit Dhal <dhal.asitk@gmail.com>2020-10-28 10:07:57 (GMT)
committerAsit Dhal <dhal.asitk@gmail.com>2020-12-21 11:16:16 (GMT)
commitc3385dd8bd7c78cf03d7e52ae0f49e8216cdaaea (patch)
tree429c6d6e88db90402670eef5e288f7f4a1bb29ca /Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
parentc89514a6a47b678dddb703c302def4fe56abe275 (diff)
downloadCMake-c3385dd8bd7c78cf03d7e52ae0f49e8216cdaaea.zip
CMake-c3385dd8bd7c78cf03d7e52ae0f49e8216cdaaea.tar.gz
CMake-c3385dd8bd7c78cf03d7e52ae0f49e8216cdaaea.tar.bz2
file(GENERATE): Support options to manipulate file permissions
Fixes: #15653
Diffstat (limited to 'Tests/RunCMake/File_Generate/CustomFilePermissions.cmake')
-rw-r--r--Tests/RunCMake/File_Generate/CustomFilePermissions.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake b/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
new file mode 100644
index 0000000..0000ef9
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
@@ -0,0 +1,15 @@
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/customfilepermissions.txt")
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/customfilepermissions.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_EXECUTE
+ WORLD_EXECUTE
+ )
+
+add_custom_target(checkCustomFilePermissions ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/customfilepermissions.txt
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/CustomFilePermissionsVerify.cmake"
+ )