How do a specify a library file dependency for qmake in Qt?


Question

Have a SomeLib.pro file that contains:

CONFIG  += debug
TEMPLATE = lib
TARGET = SomeLib
..

Then in a dependent SomeApp.pro:

..
debug:LIBS += -lSomeLib_debug
..

How can I force SomeApp to build if I touched SomeLib in qmake?

1
9
4/23/2009 12:31:00 PM

Accepted Answer

It's ugly because you need to give the exact library file name, but this should work:

TARGETDEPS += libfoo.a

16
4/23/2009 10:07:36 PM

QT Creator will do the work if you click "Add library..." in the context menu of the project that should include the library.

These variables are configured automatically for you:

  • LIBS
  • INCLUDEPATH
  • DEPENDPATH
  • PRE_TARGETDEPS

See also http://doc.qt.digia.com/qtcreator-2.1/creator-project-qmake-libraries.html


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon