PDA

View Full Version : QMake: Solve Dependencies Automatically



blueSpirit
21st January 2012, 15:01
Hello,

I'd like to add something like this to my Qt project file:


STATIC_LIBRARIES += myaudio myxxxx

for( dep, STATIC_LIBRARIES ) {
message($$TARGET depends on $$dep ($${DESTDIR}/$${dep}.$${STAT_EXT}))
LIBS += $${DESTDIR}/lib$${dep}.$${STAT_EXT}
PRE_TARGETDEPS += $${DESTDIR}/lib$${dep}.$${STAT_EXT}

$${dep}.input = ../$${dep}/Makefile
$${dep}.commands = cd ../$${dep} && make ;
$${dep}.CONFIG = no_link
$${dep}.output = $${DESTDIR}/libX$${dep}.$${STAT_EXT}

QMAKE_EXTRA_COMPILERS += $${dep}
}
I guess it's not working, since 'the object' cannot be a variable. But the output of qmake looks like this...

Project MESSAGE: graph depends on myaudio (../../bin/myaudio.a)
Project MESSAGE: graph depends on myxxxx (../../bin/myxxxx.a)
WARNING: Compiler: myaudio: No output file specified
WARNING: Compiler: myxxxx: No output file specified
So at least a part of it is working...

Thanks,

Charly

ChrisW67
24th January 2012, 01:22
Is there a question somewhere in there?