Results 1 to 4 of 4

Thread: qmake post compile step

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question qmake post compile step

    Hello,
    how is it possible to do a custom compile step in the .pro file after each step (compiling cpp file)?

  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: qmake post compile step

    You can create custom "compilers" (generic term : uic, rcc and moc are compilers in qmake terms) to handle the content of variables or you create extra targets and specify whether they should be executed before or after compilation. All this is explained relatively clearly in the docs.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Jun 2009
    Posts
    11
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake post compile step

    I just found how to execute commands after / before the linking step.
    I want something in the Makefile like:
    Qt Code:
    1. a.cpp: a.h
    2. gcc -c a.cpp -o a.o
    3. <new command>
    4.  
    5. b.cpp: b.h a.h
    6. gcc -c b.cpp -o b.o
    7. <new command>
    To copy to clipboard, switch view to plain text mode 
    While <new command> should be a command that i want to enter
    this command should be after each gcc command.
    I just found QMAKE_RUN_CXX, but i know, whether this is the right choice or not, because it does not work.

  4. #4
    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: qmake post compile step

    Did you take the trouble to follow the link on custom compilers above? This approach can satisfy your needs. It will require extra care to keep everything cross-platform though as you want to mess with SOURCES variable but it's doable for sure.
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. qtgui4.dll error in visual c++ 2005
    By Comptrol in forum Installation and Deployment
    Replies: 33
    Last Post: 19th June 2008, 07:18
  2. Access to PostgreSQL DB on a linux server
    By rmagro in forum Qt Programming
    Replies: 28
    Last Post: 13th March 2008, 09:02
  3. qmake: add to project but do not compile
    By jesse in forum Newbie
    Replies: 2
    Last Post: 8th November 2007, 16:03
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  5. Qt-4.2.2 qmake won't compile under visual studio 2005 on vista
    By moowy in forum Installation and Deployment
    Replies: 7
    Last Post: 13th January 2007, 21:06

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.