Qt Creator debugging static lib
-
wrote on 15 Mar 2011, 21:47 last edited by
I think it's more a make than a qmake problem, isn't it?
If the pro is not changed, just make is called...but is make called for both projects, or only for the projects ith changes?
so thejn it's a creator issue, as creator also calls make...
-
wrote on 15 Mar 2011, 21:49 last edited by
Looking at the output it looks like just make is called, above that it says "Configuration unchanged, skipping qmake step.". Then in the make call it enters the shadow directory, then spits out "nothing to be done", leaves the directory and exist.
-=ben
-
wrote on 15 Mar 2011, 21:57 last edited by
[quote author="mirswith" date="1300225793"]Looking at the output it looks like just make is called, above that it says "Configuration unchanged, skipping qmake step.". Then in the make call it enters the shadow directory, then spits out "nothing to be done", leaves the directory and exist.
-=ben[/quote]
That's expected behavior :-)
-
wrote on 15 Mar 2011, 22:00 last edited by
Shouldn't it link the static lib though since changes in the static lib occurred?
-=ben
-
wrote on 15 Mar 2011, 22:02 last edited by
only if you add to your .pro file:
@
PRE_TARGETDEPS = ../path/to/your/lib/liba.a
@ -
wrote on 15 Mar 2011, 22:05 last edited by
AHHH.. THANK YOU! That is the bit of magic that I was missing. :D One would think that check marking the project as a Dependency in the Projects setting would accomplish this, but I am sure that would be WAY to easy! ;)
-=ben
-
wrote on 15 Mar 2011, 22:24 last edited by
The dependency in the project configuration basically influences the build order (that's one thing that Creator handles itself). Without the PRE_TARGETDEPS (or one of its friends), the lib is not in the dependency list of qmake (and subsequently of the Makefile) and so none of the tools cares if it changed.
-
wrote on 16 Mar 2011, 08:11 last edited by
mirswith: The inter-project dependencies have severe limitations. In fact we discussed to remove them again...
Please use your build system to link to sub-projects together. All of them provide means to add proper dependency tracking between (sub-)projects. We do not want to introduce a similar logic into creator itself: It would be prone to errors, hardly tested and will require the developer to understand a new set of dependency logics in addition to the one already required by the build system.
-
wrote on 16 Mar 2011, 12:49 last edited by
Tobias, but there will remain a configuration option to set the build order in Qt Creator?
-
wrote on 16 Mar 2011, 12:58 last edited by
Volker: We only talked about it and did not change any code.
-
wrote on 16 Mar 2011, 13:04 last edited by
Thanks Tobias for clarification. I like the dependency tool, but it would be sufficient for my use cases to set the build order. So, at least this should remain.
-
wrote on 17 Mar 2011, 10:55 last edited by
mirswith: You could have actually used Qt Creators wizard to add a library. That does add the required qmake magic:-) Another hidden gem in Qt Creator...
Open the .pro-file you want to add a library to. Right click anywhere in the editor and select "Add library" from the context menu to bring up a wizard to help with the task.
Yes, that is very well hidden, I only found this by accident right now. I'll open a issue with our bug tracker to make that way more visible.
-
wrote on 17 Mar 2011, 13:32 last edited by
better use cmake for real projects.
cmake rebuilds all libs and dependent executables when a source file changes. In qmake you need to specify dependencies and I found this all very fragile. The trolls continue to use qmake because of requirements you probably do not have, for example running on esoteric platforms, continuing backwards compatibility, etc.
Give cmake a try!
16/19