permission problem when installing files while I do have write permission


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

CMake Error at src/cmake_install.cmake:45 (file):
file INSTALL cannot set permissions on

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

$ 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!


I believe the problem you are observing is the same as CMake Issue 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.