Qt4-preview-feedback Archive, July 2007
Qt - Eclipse Integration: qmake generated Makefiles and external dependencies
Message 1 in thread
Hello,
I am having a problem with the Eclipse integration. My workspace
consists of two projects, say ProjectA and ProjectB. Project B is
mostly a collection of custom Qt widgets and dialogs. I am compiling
these into a static library, so part of ProjectB.pro looks like this:
--- excerpt from ProjectB.pro
TEMPLATE = lib
CONFIG = qt \
staticlib \
warn_on \
windows \
rtti_off \
debug_and_release_target \
stl_off \
debug_and_release \
uic \
resources
---
ProjectA is a GUI program that uses functionality from ProjectB.
It's .pro file includes this:
--- excerpt from ProjectA.pro
QMAKE_LFLAGS_DEBUG += -L"relative/path/to/ProjectB/debug"
QMAKE_LFLAGS_RELEASE += -L"relative/path/to/ProjectB/release"
LIBS += -lProjectB
---
So far so good. Now in Eclipse, I add a reference to ProjectB in the
ProjectA properties. As a result, ProjectB is updated every time I try
to launch ProjectA, as expected.
The problem now is that ProjectA does not seem to recognize that the
static lib (libProjectB.a) it depends on changed, so it does not get
re-linked, and the new lib is never used (unless I do a "make clean"
in ProjectA before).
Is this an Eclipse integration problem? A qmake problem? Or me using
the tools incorrectly?
Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 2 in thread
Hi Holger,
>The problem now is that ProjectA does not seem to recognize that the
>static lib (libProjectB.a) it depends on changed, so it does not get
>re-linked, and the new lib is never used (unless I do a "make clean"
>in ProjectA before).
>
>Is this an Eclipse integration problem? A qmake problem? Or me using
>the tools incorrectly?
Just thought I might help on that one. It's not an Eclipse Integration problem, but comes from qmake, although it's not really a problem, it's just how it works.
By default external libraries are not included in the dependencies for the final executable, simply because they're not part of the project itself. So conceptually they're not considered as dependencies, merely a linker option.
However you can force it by adding the following line in your .pro file for ProjectA :
POST_TARGETDEPS += /path/to/libProjectB.a
That'll add the dependency you want.
Best regards,
Romain Pokrzywka
Software Engineer, Qt Consultant, Qt Trainer
KDAB - KlarÃlvdalens Datakonsult AB
http://www.kdab.com
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
Message 3 in thread
On Fr, 13.07.2007 15:43, Romain Pokrzywka wrote:
>>The problem now is that ProjectA does not seem to recognize that the
>>static lib (libProjectB.a) it depends on changed, so it does not get
>>re-linked, and the new lib is never used (unless I do a "make clean"
>>in ProjectA before).
>>
>>Is this an Eclipse integration problem? A qmake problem? Or me using
>>the tools incorrectly?
>
>However you can force it by adding the following line in your .pro file for ProjectA :
>
>POST_TARGETDEPS += /path/to/libProjectB.a
>
>That'll add the dependency you want.
That is indeed very nice! Thanks, Romain :-)
Holger
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx