[mythtv] Problems getting qmake to generate dependencies

Joseph A. Caputo jcaputo1 at comcast.net
Mon Dec 19 14:33:03 EST 2005


On Monday 19 December 2005 13:14, Geoffrey Hausheer wrote:
> On 12/19/05, Geoffrey Hausheer wrote:
> > Does anyone understand how qmake works?
> >
> > I've read all the docs, and as far as I can tell mythtranscode.pro 
> > is 
> > corrct, but qmake is not generating the propper dependencies for
> > mpeg2fix.cpp.  It only includes avformat.h and not mpeg2.h, 
> > avcodec.h 
> > or (most importantly) replex/multiplex.h, replex/mpg_common.h, and
> > replex/ringbuffer.h (all included from within mpeg2fix.h)
> >
> > I have no idea why, but it causes mythtranscode to be built
> > incorrectly when those header files change, causing users to see 
> > bugs 
> > that I can't reproduce.
> >
> Well, i've solved it.
> 
> Apparently even with INCLUDEPATH set appropriately, qmake doesn't 
> like: 
> #include "avcodec.h"
> or
> #include "libavcodec/avcodec.h"
>  But it does work with
> #include "../libavcodec/libavcodec.h"
> 
> Ah well.
> .Geoff

INCLUDEPATH will only affect the "-I" directives in the generated 
makefile.  To generate dependencies, you need to set the DEPENDPATH 
variable.  By default, the DEPENDPATH is "." (plus other directories 
depending on how qmake was called when the .pro file was initially 
generated).  So, by specifying a relative include pattern in your 
source file, the DEPENDPATH picked up the dependency.  Be careful, 
though... qmake will attempt to compute the entire include closure 
dependency of the file, not just the direct include dependency.  This 
is generally the "correct" behavior, but can sometimes cause things to 
be unnecessarily rebuilt, because qmake doesn't look at preprocessor 
directives within source files (though I think that feature has been 
added for Qt 4)

HTH,
JAC

-JAC


More information about the mythtv-dev mailing list