I'm about to embark upon a new project for which I'm considering transitioning to qmake as the build system from my long-time standard of the GNU Autotools. This is desirable as I've transitioned largely from C to C++/Qt. However, I'm encountering an undesirable behavior (or misunderstanding) regarding the DESTDIR project file variable.

With Automake/Autoconf and a destination directory such as /opt/testapp (requiring root privileges for write access) I can perform the initial build steps with permissions of a regular user as follows:

./configure
make


Only the final make install step should require root permissions.

With qmake I am finding this not to be the case. I have added the following configuration lines to my respective project files (my source tree has various component applications in subdirectories, each with their own .pro file invoked by a single top-level file):


unix {
DESTDIR = /opt/testapp
}


When this stanza is in place, the normal

qmake-qt4 toplevel.pro
make


command sequence will fail if executed if performed with regular user permissions because it cannot access the protected installation path. This seems in error to me as there should be no need to access the installation directory until component installations are to be performed.

I do not wish to perform the basic build steps with root privileges just to work around this problem. I only wish to use root privileges for the final make install step (or its qmake equivalent). What am I doing wrong here? Is there a qmake parallel for the build sequence I am used to? I can continue to use the GNU Autotools (for my Unix builds at least) but there are many appealing reasons to switch. I'm just not going to build as root.

Advice appreciated,
Bill