Dear Cmake devs,
I am having issues with files installed using CMake in a directory tree with the SGID bit set.
When set on a directory, the SGID permission bit makes such that all files under that directory will have the same linux group as that directory. So If I set the install directory to
/software/cdipietrantonio/gromacs_test_build
and that directory belongs to the group myothergroup and has the SGID bit set, then all the files installed by CMake under that directory should have the group myothergroup.
However, in some cases, the group ownership of the installed files is assigned to my user group cdipietrantonio instead of myothergroup. This makes me think that the special bit is ignored in some cases. In fact, this does not happen for every installation, and it is hard to reproduce. A case when this happen is the gromacs installation ( https://www.gromacs.org/ ).
Here is what i have in my bin directory, after the installation
drwxr-xr-x 2 cdipietrantonio pawsey0001 4.0K May 13 16:44 .
drwxr-sr-x 6 cdipietrantonio pawsey0001 4.0K May 13 16:44 ..
-rwxr-xr-x 1 cdipietrantonio pawsey0001 3.4K Apr 23 02:41 demux.pl
-rw-r--r-- 1 cdipietrantonio cdipietrantonio 138K Apr 23 02:42 gmx-completion.bash
-rw-r--r-- 1 cdipietrantonio cdipietrantonio 43 May 13 16:43 gmx-completion-gmx_mpi_d.bash
-rwxr-xr-x 1 cdipietrantonio pawsey0001 114K May 13 16:44 gmx_mpi_d
-rwxr-xr-x 1 cdipietrantonio pawsey0001 642 May 13 16:43 GMXRC
-rwxr-xr-x 1 cdipietrantonio pawsey0001 3.2K May 13 16:43 GMXRC.bash
-rwxr-xr-x 1 cdipietrantonio pawsey0001 3.1K May 13 16:43 GMXRC.csh
-rwxr-xr-x 1 cdipietrantonio pawsey0001 156 May 13 16:43 GMXRC.zsh
-rwxr-xr-x 1 cdipietrantonio pawsey0001 8.8K Apr 23 02:41 xplor2gmx.pl
in this case myothergroup = pawsey0001
How can I solve this issue?