diff options
author | Brad King <brad.king@kitware.com> | 2020-07-01 11:02:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-01 11:03:03 (GMT) |
commit | b7af2811aecf9aedf31e3ed98209b6a92c227116 (patch) | |
tree | 8c0c17a848dd71c925422a909165ec53dcd5f9f4 /Tests | |
parent | 57ea0012477828d0f2d34dde994ec6fa18cdd7a1 (diff) | |
parent | 27b03281e2028d8239c3f7e43ea67f30a70dc42b (diff) | |
download | CMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.zip CMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.tar.gz CMake-b7af2811aecf9aedf31e3ed98209b6a92c227116.tar.bz2 |
Merge topic 'configure_file-permission-control'
27b03281e2 configure_file: Add option to control file permissions transfer to copy
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4941
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/configure_file/NoSourcePermissions.cmake | 10 | ||||
-rwxr-xr-x | Tests/RunCMake/configure_file/NoSourcePermissions.sh | 3 | ||||
-rw-r--r-- | Tests/RunCMake/configure_file/RunCMakeTest.cmake | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.cmake b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake new file mode 100644 index 0000000..c6ad131 --- /dev/null +++ b/Tests/RunCMake/configure_file/NoSourcePermissions.cmake @@ -0,0 +1,10 @@ +configure_file(NoSourcePermissions.sh NoSourcePermissions.sh.out + NO_SOURCE_PERMISSIONS) + +if (UNIX) + execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/NoSourcePermissions.sh.out + RESULT_VARIABLE result) + if (result EQUAL "0") + message(FATAL_ERROR "Copied file has executable permissions") + endif() +endif() diff --git a/Tests/RunCMake/configure_file/NoSourcePermissions.sh b/Tests/RunCMake/configure_file/NoSourcePermissions.sh new file mode 100755 index 0000000..0aa8f41 --- /dev/null +++ b/Tests/RunCMake/configure_file/NoSourcePermissions.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +#Testing NO_SOURCE_PERMISSIONS option of configure_file. diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake index 32a0770..71694fb 100644 --- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake +++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake @@ -15,6 +15,7 @@ run_cmake(NewLineStyle-NoArg) run_cmake(NewLineStyle-WrongArg) run_cmake(NewLineStyle-ValidArg) run_cmake(NewLineStyle-COPYONLY) +run_cmake(NoSourcePermissions) if(RunCMake_GENERATOR MATCHES "Make") # Use a single build tree for a few tests without cleaning. |