Set Installed File Permissions for Linux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
In your .pro file, change QMAKE_INSTALL_FILE and QMAKE_INSTALL_PROGRAM to the following: | In your .pro file, change QMAKE_INSTALL_FILE and QMAKE_INSTALL_PROGRAM to the following: | ||
<code>QMAKE_INSTALL_FILE = install -m | <code>QMAKE_INSTALL_FILE = install -m <permission octals> -p -o <user> -g <group> | ||
QMAKE_INSTALL_PROGRAM = install -m <permission octals> -p -o <user> -g <group></code> | |||
where:< | where: | ||
* <permissions octals> is the standard linux permissions octals (ex: 755). | |||
* <owner> is the owner of the file. This parameter can be ommited. | |||
* <group> is the group owner of the file. This parameter can also be ommited. | |||
Here is an example implementation. In this example, I install my binary in the folder /opt/myApp and give it permissions 6755 with root as the owner and root as the group owner. | Here is an example implementation. In this example, I install my binary in the folder /opt/myApp and give it permissions 6755 with root as the owner and root as the group owner. | ||
<code>unix { | <code>unix { | ||
target.path = /opt/myApp | |||
INSTALLS += target | |||
QMAKE_INSTALL_FILE = install -m 6755 -p -o root -g root | QMAKE_INSTALL_FILE = install -m 6755 -p -o root -g root | ||
QMAKE_INSTALL_PROGRAM = install -m 6755 -p -o root -g root | |||
}</code> |
Revision as of 11:09, 25 February 2015
Here is a guide to set permissions for installed files on linux.
In your .pro file, change QMAKE_INSTALL_FILE and QMAKE_INSTALL_PROGRAM to the following:
QMAKE_INSTALL_FILE = install -m <permission octals> -p -o <user> -g <group>
QMAKE_INSTALL_PROGRAM = install -m <permission octals> -p -o <user> -g <group>
where:
- <permissions octals> is the standard linux permissions octals (ex: 755).
- <owner> is the owner of the file. This parameter can be ommited.
- <group> is the group owner of the file. This parameter can also be ommited.
Here is an example implementation. In this example, I install my binary in the folder /opt/myApp and give it permissions 6755 with root as the owner and root as the group owner.
unix {
target.path = /opt/myApp
INSTALLS += target
QMAKE_INSTALL_FILE = install -m 6755 -p -o root -g root
QMAKE_INSTALL_PROGRAM = install -m 6755 -p -o root -g root
}