Results 1 to 5 of 5

Thread: qmake INSTALLS variable not working as expected

  1. #1
    Join Date
    Feb 2009
    Posts
    33
    Thanks
    6
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default qmake INSTALLS variable not working as expected

    When I add a file to the INSTALLS variable, qmake doesn't put it in the makefile unless the file exists. Is there a way to get a file added to the INSTALLS variable that doesn't exist before qmake is run on the project file?

    Cheers,
    ~ andy.f

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: qmake INSTALLS variable not working as expected

    Do you want to install generated files?

    Use PRE_TARGETDEPS to achieve this. See for example: http://qt.gitorious.org/qt-creator/q...atorplugin.pri

    Qt Creator does something similar for pluginspec files.
    Last edited by tbscope; 9th November 2010 at 05:27.

  3. The following user says thank you to tbscope for this useful post:

    andy.fillebrown (9th November 2010)

  4. #3
    Join Date
    Feb 2009
    Posts
    33
    Thanks
    6
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake INSTALLS variable not working as expected

    Thanks! ...but wouldn't it be easier to be able to add the file to the INSTALLS variable before the file exists? All that extra compiler stuff seems like overkill for something so simple.

    Cheers,
    ~ andy.f

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake INSTALLS variable not working as expected

    Quote Originally Posted by andy.fillebrown View Post
    When I add a file to the INSTALLS variable, qmake doesn't put it in the makefile unless the file exists. Is there a way to get a file added to the INSTALLS variable that doesn't exist before qmake is run on the project file?
    As far as I remember you need to add no_path or something similar to the target configuration and use the simplified installation method (where you use the .commands subvariable) but in general how qmake installation works is that the file should exist at the time of makefile generation.

    but wouldn't it be easier to be able to add the file to the INSTALLS variable before the file exists?
    Well, it depends. Usually you don't want to receive messages that files don't exist during installation as you'd think the compilation process might have failed and you don't want to install files that shouldn't be installed (i.e. when using wildcards in files to copy, you couldn't almost ever use "*" as the file pattern as it would copy stuff such as Makefile too).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    andy.fillebrown (9th November 2010)

  7. #5
    Join Date
    Feb 2009
    Posts
    33
    Thanks
    6
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qmake INSTALLS variable not working as expected

    Thanks! Searching through the qmake source on "no_path" I discovered the "no_check_exist" .CONFIG flag. This is exactly what I was looking for. I realize it may not be portable for non-makefile project files, but I'm not really concerned about that, yet.

    Cheers,
    ~ andy.f

Similar Threads

  1. qmake INSTALLS creates dangerous makefile
    By whites11 in forum Installation and Deployment
    Replies: 5
    Last Post: 6th July 2014, 04:43
  2. Packaging with the qmake INSTALLS variable
    By Mookie in forum Installation and Deployment
    Replies: 4
    Last Post: 3rd November 2010, 19:01
  3. QTableView not working as expected.
    By junxuan in forum Qt Programming
    Replies: 7
    Last Post: 30th July 2009, 08:17
  4. pro-file's INSTALLS variable and make uninstall
    By roxton in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2008, 09:16
  5. qmake INSTALLS and subdirs template ...
    By sandros in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 22:10

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
  •  
Qt is a trademark of The Qt Company.