Results 1 to 4 of 4

Thread: qmake DESTDIR permissions behavior (Unix)

  1. #1
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question qmake DESTDIR permissions behavior (Unix)

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qmake DESTDIR permissions behavior (Unix)

    In qmake terms DESTDIR is the destination directory of the build process ("make") output. You should use the INSTALLS variable for "make install" stuff.
    J-P Nurmi

  3. #3
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake DESTDIR permissions behavior (Unix)

    The docs suggested to me that INSTALLS simply was a means of extending the set of targets to be installed, not altering the installation path. I will research it further.

    Thanks.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: qmake DESTDIR permissions behavior (Unix)

    You can install basically anything you want. Here's an example of a typical qmake feature file installation:
    qmake Code:
    1. feature.path = $$[QT_INSTALL_DATA]/mkspecs/features
    2. feature.files = mylibrary.prf
    3. INSTALLS += feature
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. qmake sux a lot
    By singermornings in forum Qt Programming
    Replies: 6
    Last Post: 29th January 2009, 08:33
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.