Results 1 to 6 of 6

Thread: need script to change qmake .pro file

  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up need script to change qmake .pro file

    Hello friends,

    I am using Qt 4.2 and Mingw compiler, I am using qmake -project option to build my application , in my program i am using network stuff,

    For that i need to add the following line in my .pro file at every time i build my application using project option,

    QT+=network

    Is there any way to write script to change .pro file ,so that i can able to add the above line into .pro file,

    Thanks
    Rajesh.S

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need script to change qmake .pro file

    Don't generate your .pro file with "qmake -project" every time. Simply edit it.

  3. #3
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: need script to change qmake .pro file

    Instead of manual editing i need some common mechanism to edit the .pro file,

    Thanks
    Rajesh.S

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: need script to change qmake .pro file

    Quote Originally Posted by rajeshs View Post
    Instead of manual editing i need some common mechanism to edit the .pro file
    Perhaps it would be easier for you to use an IDE which would manage the project file for you. Try out ones mentioned in this thread.
    J-P Nurmi

  5. #5
    Join Date
    Nov 2006
    Location
    Shrewsbury, UK
    Posts
    97
    Thanks
    3
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need script to change qmake .pro file

    Whilst I agree that it seems pretty odd to ever use qmake -project more then once, if you insist on rebuilding it every time you can easily concatenate the QT += network line. On Windows just put that single statement into a file called say qtnetwork.pri, then in your build process just include

    copy myproj.pro+qtnetwork.pri myproj.pro

    into your script. If you're on Linux then I'm sure you can adapt the principle.

    Pete

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: need script to change qmake .pro file

    Another way would be
    qmake -project "QT += network"
    but it's still odd.
    J-P Nurmi

Similar Threads

  1. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  2. Can I use the Sql Module without chanage .pro file?
    By fengtian.we in forum Qt Programming
    Replies: 9
    Last Post: 21st May 2007, 10:59
  3. who can give me a tutorials of write .pro file
    By fengtian.we in forum Qt Programming
    Replies: 5
    Last Post: 20th May 2007, 16:25
  4. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

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.