Results 1 to 4 of 4

Thread: qmake, conditioning & bundled libs

  1. #1
    Join Date
    May 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default qmake, conditioning & bundled libs

    Hi there,
    I'm writing a (linux) program which depends on 2 separate external libraries. For user convenience, I'd like to bundle these two libraries with the application, but am not sure how to build them automatically. Can it be done with qmake, so that the generated Makefile can be told to build each of the two libraries separately?

    Secondly, I need to check that Qt4.2 is being used - can this be done using qmake? I know about the $$QT_VERSION variable, but how do i compare it to >= Qt 4.2 rc1 ?

    thx,
    Seb

  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: qmake, conditioning & bundled libs

    Quote Originally Posted by sebr View Post
    I'm writing a (linux) program which depends on 2 separate external libraries. For user convenience, I'd like to bundle these two libraries with the application, but am not sure how to build them automatically.
    You can create an additional .pro file that uses the subdirs template.

    Something like:
    Qt Code:
    1. TEMPLATE = subdirs
    2. # the order of directories is important
    3. SUBDIRS += ./lib1 \
    4. ./lib2 \
    5. ./app
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by sebr View Post
    Secondly, I need to check that Qt4.2 is being used - can this be done using qmake? I know about the $$QT_VERSION variable, but how do i compare it to >= Qt 4.2 rc1 ?
    Maybe some combination of replace() and greaterThan() will do?

    http://wiki.qtcentre.org/index.php?t...cumented_qmake

    You can also try cmake instead of qmake.

  3. #3
    Join Date
    May 2006
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: qmake, conditioning & bundled libs

    Thanks for the quick reply, that wiki page was really useful.

    Another thing - do you know how it is possible to link a compiled library into the final binary?

  4. #4
    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: qmake, conditioning & bundled libs

    Quote Originally Posted by sebr View Post
    do you know how it is possible to link a compiled library into the final binary?
    Just use a static library.

Similar Threads

  1. Using qmake to build multiple apps and libs
    By marchand in forum Newbie
    Replies: 2
    Last Post: 12th June 2006, 17:33
  2. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

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.