qmake generates the following rule for installing a target:

Qt Code:
  1. -$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(TARGET)"
To copy to clipboard, switch view to plain text mode 

I cannot set INSTALL_ROOT with something like this in a *.pro file

Qt Code:
  1. isEmpty(INSTALL_ROOT) {
  2. INSTALL_ROOT=/usr
  3. }
To copy to clipboard, switch view to plain text mode 

because INSTALL_ROOT is somehow local to generated Makefiles. According to what I've found out so far INSTALL_ROOT is empty by default. It could be used like

Qt Code:
  1. INSTALL_ROOT=$HOME make install
To copy to clipboard, switch view to plain text mode 

when invoking make, which is fine. However I want to be able to specify default installation root, say /usr. I can do it introducing a new variable PREFIX as suggested here. Then generated rule will look like (if PREFIX was set to /usr)

Qt Code:
  1. -$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/usr/$(TARGET)"
To copy to clipboard, switch view to plain text mode 

however, if somebody calls

Qt Code:
  1. INSTALL_ROOT=$HOME make install
To copy to clipboard, switch view to plain text mode 

then target will be installed to
Qt Code:
  1. /home/<user_name>/usr/$(TARGET)
To copy to clipboard, switch view to plain text mode 
which is not that one would expect.

So setting INSTALL_ROOT to some default value will produce consistent behavior, which is superior to adding PREFIX, but how to set INSTALL_ROOT in a *.pro file?