Results 1 to 5 of 5

Thread: Packaging with the qmake INSTALLS variable

  1. #1
    Join Date
    Jun 2006
    Posts
    43
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Cool Packaging with the qmake INSTALLS variable

    My question has details that are win32 specific, but the question itself is applicable cross-platform.

    I have an application that is dependent on many DLLs and other file types in order to function. I currently use NSIS to package them but am moving toward automating this step in the project file.

    Currently I am using the INSTALLS variable to copy all required files to a packaging directory, but need some sort of "post install" call of the NSIS executable. This would actually perform the packaging.

    Qt Code:
    1. package.path = $${OUT_PWD}/package
    2. package.files += myapp.exe package.nsi somelib.dll
    3. INSTALLS *= package
    4.  
    5. package_media.path = $${OUT_PWD}/package/media
    6. package_media.files += image.jpg video.mpg
    7. INSTALLS *= package_media
    8.  
    9. # A target to execute (not sure how yet)
    10. build_package.commands = \"C:/Program Files/NSIS/makensisw.exe\" \"$${OUT_PWD}/package/package.nsi\"
    11.  
    12. # Set up an echo dependency to tell user what I'm doing
    13. build_package.depends = build_package_echo
    14. build_package_echo.commands = @echo Building package
    To copy to clipboard, switch view to plain text mode 
    How do I actually get the build_package target to execute?

    It must be...

    1. Only during the "make install" phase.
    2. Only after all the INSTALLS copying is done.
    Last edited by Mookie; 3rd November 2010 at 18:05.

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

    Default Re: Packaging with the qmake INSTALLS variable

    Did you try "INSTALLS+=build_package"?
    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.


  3. #3
    Join Date
    Jun 2006
    Posts
    43
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: Packaging with the qmake INSTALLS variable

    build_package required that build_package.path be set first. See below...

    Qt Code:
    1. package.path = $${OUT_PWD}/package
    2. package.files += myapp.exe package.nsi somelib.dll
    3. INSTALLS += package
    4.  
    5. package_media.path = $${OUT_PWD}/package/media
    6. package_media.files += image.jpg video.mpg
    7. INSTALLS += package_media
    8.  
    9. # Set the running directory
    10. build_package.path = $${OUT_PWD}/package
    11. # Set command to execute
    12. build_package.commands = \"C:/Program Files/NSIS/makensisw.exe\" package.nsi
    13. build_package.depends = $${INSTALLS}
    14. INSTALLS += build_package
    15.  
    16. # There are no further INSTALLS below here.
    To copy to clipboard, switch view to plain text mode 
    There appears to be an ordering problem now and I cannot ensure that build_package goes last.

    I made the attempt to set a .depends above "INSTALLS += build_package" to force the issue, but it failed to do so.
    Last edited by Mookie; 3rd November 2010 at 18:05.

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

    Default Re: Packaging with the qmake INSTALLS variable

    Try:
    qmake Code:
    1. build_package.depends += install_package install_package_media
    To copy to clipboard, switch view to plain text mode 
    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.


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

    Mookie (3rd November 2010)

  6. #5
    Join Date
    Jun 2006
    Posts
    43
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Wink Re: Packaging with the qmake INSTALLS variable

    Excellent. That worked.

    I didn't realize that the .depends required the name-mangled version of the dependency target used by the makefile itself.

    Thank you very much.


    Added after 30 minutes:


    The working solution. For posterity.

    Qt Code:
    1. package.path = $${OUT_PWD}/package
    2. package.files += myapp.exe package.nsi somelib.dll
    3. INSTALLS += package
    4.  
    5. package_media.path = $${OUT_PWD}/package/media
    6. package_media.files += image.jpg video.mpg
    7. INSTALLS += package_media
    8.  
    9. # Do the packaging
    10. #
    11. # First, mangle all of my INSTALLS values. I depend on them.
    12. unset(MANGLED_INSTALLS)
    13. for(x, INSTALLS):MANGLED_INSTALLS += install_$${x}
    14. build_package.path = $${OUT_PWD}/package
    15. build_package.commands = \"C:/Program Files/NSIS/makensisw.exe\" \"$${OUT_PWD}/package/package.nsi\"
    16. build_package.depends = $${MANGLED_INSTALLS}
    17. INSTALLS += build_package
    18.  
    19. # There are no further INSTALLS below here.
    To copy to clipboard, switch view to plain text mode 
    Last edited by Mookie; 3rd November 2010 at 19:02. Reason: Repetitive text

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. Qmake variable
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 29th July 2009, 14:00
  3. qmake - how to extract number from variable
    By Vanir in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2009, 18:12
  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

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.