# permission problem when installing files while I do have write permission

**URL:** https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292
**Category:** Usage
**Created:** [December 1, 2019, 5:41pm UTC](https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292 "2019-12-01T17:41:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kristhielemans/32/532_2.png) [@KrisThielemans](https://discourse.cmake.org/u/KrisThielemans)
#### Post date: [December 1, 2019, 5:41pm UTC](https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292/1 "2019-12-01T17:41:17Z")

</div>

Hi

I’m trying to install files in a directory (let’s call it `/install`) where I have write permissions, but that we share with people in the same “group”

Doing “make install” runs fine until I get

```auto
CMake Error at src/cmake_install.cmake:45 (file):
file INSTALL cannot set permissions on
"/install/include"

```

This seems to be because that directory is owned by another user in our group. Permissions are

```auto
$ ls -l /install
drwxrws--- 7 otheruser ourgroup 10240 Nov 28 23:21 include

```

which seems fine to me. This also happens with existing single files owned by another user. I can delete these files/directories and then everything works.

This is on CentOS 7, CMake 3.10.2 (I could use a more recent version if that’d help).

Thanks in advance!

kris

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [December 4, 2019, 2:24pm UTC](https://discourse.cmake.org/t/permission-problem-when-installing-files-while-i-do-have-write-permission/292/2 "2019-12-04T14:24:08Z")

</div>

I believe the problem you are observing is the same as [CMake Issue 10978](https://gitlab.kitware.com/cmake/cmake/issues/10978).

CMake does assume that it can set permissions on files and directories it installs. The `install()` command has options to control the permissions that get set so we need to be able to set them to honor those (even if just the defaults). An `install(DIRECTORY)` call implies that permissions should be set on the installed directory.
