On 06/29/2010 12:44 PM, ext John Vilburn wrote:
> Using a shadow build breaks my .pro file on Mac because my project uses
> SUBDIRS to build some frameworks, and then builds the final .app. In the
> .app I include those frameworks as private frameworks. The rule to add
> those frameworks looks something like this:
>
> PRIVATE_FRAMEWORKS.files = ../Framework1/Framework1.framework 
> ../Framework2/Framework2.framework
>
> In this case, the ../ is interpreted by the build as relative to the
> source directory, not the shadow build directory. But those frameworks
> are created in the shadow build directory. What is the proper method to
> specify those paths so they will be relative to the build directory
> whether it is a shadow build or not?

Since these are indeed products of your build, the proper way to refer 
to them is probably by doing it relative from $$OUT_PWD:

http://doc.qt.nokia.com/4.6/qmake-variable-reference.html#out-pwd

> Is the assumption being made that OBJECTS_DIR, UI_DIR, and others should 
> always be relative paths? If that assumption is true, then it seems to me 
> that specifying a shadow build directory should not break the .pro file. 
> Perhaps the difficulty with shadow builds arises when developers put absolute 
> paths in OBJECTS_DIR and such, because then the OBJECTS_DIR would override 
> the shadow build dir, rather than work with it. Am I right? If I am missing 
> something, please explain in more detail how setting the shadow build dir "is 
> quite different from setting OBJECTS_DIR, UI_DIR, etc."

I think they should really always be relative, yes. I'm not sure what 
the use-case would be of using absolute paths. A properly written .pro 
file should indeed not break when using shadow builds.

Of course, I can sympathize with the problems many are having now and 
the lack of documentation. It was a hard choice to make between breaking 
some projects by doing shadow builds by default (which can generally be 
fixed), or not being able to support building against different Qt 
configurations properly (desktop, Maemo, S60, Simulator, etc.)

Of course, maybe it still makes sense to have an option to disable the 
"shadow-build by default" thing for those not interested in building for 
different targets.

Regards,
Bjørn

-- 
Thorbjørn Lindeijer
Software Engineer
Nokia, Qt Development Frameworks
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to