Results 1 to 3 of 3

Thread: How to add functions to a .pro file using QMake command line?

  1. #1
    Join Date
    Jul 2008
    Posts
    31
    Thanks
    1
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to add functions to a .pro file using QMake command line?

    Dear all,

    I create .pro files by using the following syntax:
    Qt Code:
    1. qmake -project <project name>.pro [VARIABLES] .
    To copy to clipboard, switch view to plain text mode 

    Such as:
    Qt Code:
    1. qmake -project MyProject.pro "UI_DIR = ui" "RC_FILE = MyProject.rc" "QT += network" .
    To copy to clipboard, switch view to plain text mode 

    However, unlike variables I can't see how it's possible to add functions to a .pro file via the command line. I would like the following line to appear in my .pro file:
    Qt Code:
    1. include( $$(QTHOME)/my-extension/myext.prf )
    To copy to clipboard, switch view to plain text mode 

    But the following does not work:
    Qt Code:
    1. qmake -project MyProject.pro "UI_DIR = ui" "RC_FILE = MyProject.rc" "QT += network"
    2. "include( $$(QTHOME)/my-extension/myext.prf )" .
    To copy to clipboard, switch view to plain text mode 

    I'm sure this must be documented somewhere, but that somewhere is escaping me...

    All help appreciated.

    Kind Regards,

  2. The following user says thank you to Paladin12 for this useful post:


  3. #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: How to add functions to a .pro file using QMake command line?

    No, I don't think that's possible. But you can use echo or cat to redirect something into the pro file. You might introduce a wrapper over the qmake executable if you need to inject functions into project files on a regular basis.
    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.


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


  5. #3
    Join Date
    Jul 2008
    Posts
    31
    Thanks
    1
    Thanked 5 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to add functions to a .pro file using QMake command line?

    Hi Wysota,

    Thanks for responding.

    I added the following to my build script (I'm working on windows) after the 'qmake -project' line:
    Qt Code:
    1. echo include( %QTHOME%\my-extension\myext.prf)>>MyProj.pro
    To copy to clipboard, switch view to plain text mode 

    It works fine now.

    Cheers,

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


Similar Threads

  1. qmake can't process project file on windows
    By s-troz in forum Qt Programming
    Replies: 3
    Last Post: 25th October 2008, 14:51
  2. pass code from .pro file through to Makefile in qmake?
    By rholsen in forum Qt Programming
    Replies: 2
    Last Post: 16th October 2008, 18:51
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Replies: 2
    Last Post: 8th November 2007, 20:15
  5. need script to change qmake .pro file
    By rajeshs in forum Qt Programming
    Replies: 5
    Last Post: 7th July 2007, 17:53

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.