I would like to be able to set global default install permissions, so I don’t have to either rewrite each and every install(...)
command, or override it with a custom install(...)
command in my project.
There already is the CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
variable for implicitly created dirs during installation.
The following additional variables could be added for all the different install command signatures:
-
CMAKE_INSTALL_DEFAULT_TARGET_ARCHIVE_PERMISSIONS
forinstall(TARGETS ...)
-
CMAKE_INSTALL_DEFAULT_TARGET_LIBRARY_PERMISSIONS
forinstall(TARGETS ...)
-
CMAKE_INSTALL_DEFAULT_TARGET_RUNTIME_PERMISSIONS
forinstall(TARGETS ...)
- …
In my project I could then just e.g. list(APPEND CMAKE_INSTALL_DEFAULT_TARGET_ARCHIVE_PERMISSIONS GROUP_WRITE)
I could also set the global install permissions in an initial cache file.
Another benefit would be the ability to change the install permissions of upstream projects on configuration.