Results 1 to 2 of 2

Thread: library not build automatically

  1. #1
    Join Date
    Mar 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default library not build automatically

    Hi folks,

    I'm new to Qt, qmake and this group, so please forgive my ignorace. I've searched the forums for my problem but to no avail...

    I have a small build problem with qmake which I don't know how to solve...

    My code is organized as:

    sw/gen/inc
    sw/gen/src
    sw/gen/gen.pro --> builds a static library of all sources in gen/src and puts it in sw/gen/lib as libgen.a

    sw/app/src
    sw/app/app.pro --> builds the sources of app/src and indicates (-L../gen/lib -lgen) that it shall link libgen.a.

    However, if I change a source file in gen/src and then build the application, the library is not automaticlly rebuild. Or: if I rebuild the library myself and then rebuild the application, make tells me that there is nothing to do... This is annoying.

    What must I do to my .pro files to set these dependencies?

    Kind regards,

    Koos

  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: library not build automatically

    You need another .pro file in sw directory:
    TEMPLATE = subdirs
    CONFIG += ordered
    SUBDIRS += gen app
    If you use it to build your project, it will try to build the library first and then the application.

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. Wrap a static QT library inside an XPCOM component ?
    By Paul_Xul in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2010, 07:16
  3. Replies: 1
    Last Post: 5th March 2007, 20:50
  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.