Results 1 to 7 of 7

Thread: Post-Build actions using qmake

  1. #1
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Post-Build actions using qmake

    Is it possible to define some actions in the project file
    which is executed after the build is done?

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Post-Build actions using qmake

    This is documented...
    These two variables may reveal interesting if you're looking for some automation : PRE_TARGETDEPS and POST_TARGETDEPS.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Post-Build actions using qmake

    But aren't they just for libraries, and other build targets?

    What I had in mind was something like zipping, moveing, and/or deleting files.

  4. #4
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Post-Build actions using qmake

    how could that be platform independant?

  5. #5
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Post-Build actions using qmake

    Quote Originally Posted by aMan View Post
    how could that be platform independant?
    By using a couple of scopes :
    Qt Code:
    1. mytarget.target = ...
    2. mytarget.depends = ...
    3.  
    4. unix {
    5. mytarget.commands = ...
    6. }
    7.  
    8. win32 {
    9. mytarget.commands = ...
    10. }
    11.  
    12. macx {
    13. mytarget.commands = ...
    14. }
    To copy to clipboard, switch view to plain text mode 

    Note : the last time I tried using this mechanism, everything worked fine except for a single thing : I did not see any difference between PRE_TARGETDEPS and POST_TARGETDEPS... Whatever I did, my additional target got processed BEFORE compilation... Is is me or is it a bug in qmake?
    Current Qt projects : QCodeEdit, RotiDeCode

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

    bhs-ittech (11th September 2007)

  7. #6
    Join Date
    Aug 2006
    Posts
    25
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Post-Build actions using qmake

    Thanks,
    that cleared it up for me.
    Now I'm able to do what I intended, and find the relevant information
    in the documentation

    Again thanks alot

  8. #7
    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: Post-Build actions using qmake

    Quote Originally Posted by fullmetalcoder View Post
    Whatever I did, my additional target got processed BEFORE compilation... Is is me or is it a bug in qmake?
    I think it is meant to be that way. At least that's what the docs suggest.

    As far as I understand it, it is like this:

    $(LINKER) $(PRE_TARGETDEPS) -o $(TARGET) $(POST_TARGETDEPS)

    So both PRE and POST have to be built before the actual target. Those variables only determine the moment when they will be linked (the order of linked libraries is sometimes important).

Similar Threads

  1. build lib and dll with qmake
    By jh in forum Qt Programming
    Replies: 15
    Last Post: 17th August 2010, 21:10
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. qmake to build both 32-bit and 64-bit
    By lni in forum Qt Programming
    Replies: 8
    Last Post: 12th December 2006, 19:35
  4. Using qmake to build multiple apps and libs
    By marchand in forum Newbie
    Replies: 2
    Last Post: 12th June 2006, 17:33
  5. QMAKE: Specifying Build Dependencies
    By JohnSuykerbuyk in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2006, 09:46

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.