PDA

View Full Version : qmake, conditioning & bundled libs



sebr
28th September 2006, 12:28
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

jacek
28th September 2006, 13:31
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:


TEMPLATE = subdirs
# the order of directories is important
SUBDIRS += ./lib1 \
./lib2 \
./app


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?title=Undocumented_qmake

You can also try cmake instead of qmake.

sebr
29th September 2006, 04:05
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?

jacek
29th September 2006, 10:38
do you know how it is possible to link a compiled library into the final binary?
Just use a static library.