How to set linux permissions to installed files with QMake
-
Hello,
Here is a guide to set permissions for installed files on linux.
I've looked at these references:
http://qt-project.org/doc/qt-4.8/qmake-advanced-usage.html
http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html
http://paulf.free.fr/undocumented_qmake.html
http://www.qtcentre.org/wiki/index.php?title=Undocumented_qmake
But couldn't find any mention of setting permissions.According to this post: http://www.qtcentre.org/threads/13687-How-to-set-permission-of-installed-files-via-qmake there is a QMake variable called QMAKE_INSTALL_FILE but this is not documented in the variables reference link above.
Thus I modified my .pro file to the following:
@unix {
target.path = /opt/my_app_dir
INSTALLS += targetQMAKE_INSTALL_FILE = install -m 6755 -p -o root -g root QMAKE_INSTALL_PROGRAM = install -m 6755 -p -o root -g root
}@
Where /opt/my_app_dir is the directory in which I wanted to install my file.
I got the "install" options from http://linux.about.com/library/cmd/blcmdl1_install.htmCheers,
Daniel K. -
How about to post this like article in wiki? :)
-
Great suggestion, I've just created one now: http://qt-project.org/wiki/How_to_set_installed_file_permissions_for_Linux
Thanks!
-
The wiki page has been moved by another user. The new link is: http://qt-project.org/wiki/Set-Installed-File-Permissions-for-Linux