diff options
author | Brad King <brad.king@kitware.com> | 2017-11-09 13:28:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-11-09 13:28:28 (GMT) |
commit | 05d8892e6113272c9b9ab73ceb9c8319e6690a25 (patch) | |
tree | 5ea42b3575d6b24118ffe6d25a3cbc24d3142be6 /Source/cmFSPermissions.h | |
parent | 0682e77f3b65850d37d8d91533c62b30a348454b (diff) | |
parent | 7e896029cd6bc0a19b7e0ed6fa7b876e0f1764b3 (diff) | |
download | CMake-05d8892e6113272c9b9ab73ceb9c8319e6690a25.zip CMake-05d8892e6113272c9b9ab73ceb9c8319e6690a25.tar.gz CMake-05d8892e6113272c9b9ab73ceb9c8319e6690a25.tar.bz2 |
Merge topic 'cmake-default-dir-install-permissions'
7e896029 CPack: enable setting default dir creation permissions
a4c82916 CPack test: expand output checking fallback
670ad047 Move file/dir permissions code to common file.
deeba85f CMake: enable setting default dir creation permissions
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1433
Diffstat (limited to 'Source/cmFSPermissions.h')
-rw-r--r-- | Source/cmFSPermissions.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Source/cmFSPermissions.h b/Source/cmFSPermissions.h new file mode 100644 index 0000000..7a6e708 --- /dev/null +++ b/Source/cmFSPermissions.h @@ -0,0 +1,45 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmFSPermissions_h +#define cmFSPermissions_h + +#include "cmConfigure.h" // IWYU pragma: keep + +#include "cm_sys_stat.h" + +#include <string> + +namespace cmFSPermissions { + +// Table of permissions flags. +#if defined(_WIN32) && !defined(__CYGWIN__) +static const mode_t mode_owner_read = S_IREAD; +static const mode_t mode_owner_write = S_IWRITE; +static const mode_t mode_owner_execute = S_IEXEC; +static const mode_t mode_group_read = 040; +static const mode_t mode_group_write = 020; +static const mode_t mode_group_execute = 010; +static const mode_t mode_world_read = 04; +static const mode_t mode_world_write = 02; +static const mode_t mode_world_execute = 01; +static const mode_t mode_setuid = 04000; +static const mode_t mode_setgid = 02000; +#else +static const mode_t mode_owner_read = S_IRUSR; +static const mode_t mode_owner_write = S_IWUSR; +static const mode_t mode_owner_execute = S_IXUSR; +static const mode_t mode_group_read = S_IRGRP; +static const mode_t mode_group_write = S_IWGRP; +static const mode_t mode_group_execute = S_IXGRP; +static const mode_t mode_world_read = S_IROTH; +static const mode_t mode_world_write = S_IWOTH; +static const mode_t mode_world_execute = S_IXOTH; +static const mode_t mode_setuid = S_ISUID; +static const mode_t mode_setgid = S_ISGID; +#endif + +bool stringToModeT(std::string const& arg, mode_t& permissions); + +} // ns + +#endif |