PDA

View Full Version : Force qmake to compile nothing



yakin
27th November 2011, 19:37
I wrote an extra compiler configuration to build *.mo files from *.po files in an xgettext environment. That works fine. But if I use "lib" as qmake template, qmake builds the mo files and an unwanted empty library. If I use "app" as template, qmake tries to build an application without source files which leads to an compile error. If I use "subdirs" of cause nothing will be builded even not the *.mo files.
Is there a way to tell qmake just to use the extra compiler and do nothing else?

yakin
7th December 2011, 11:40
I found a solution for this with a little trick:

TEMPLATE=app
TARGET=nocompile
TARGET_EXT=.time
win32 {
QMAKE_LINK=touch nocompile.time && echo
}
else {
QMAKE_LINK=touch nocompile.time; echo
}

This overwrites the linker command and creates the expected result via touch. This is nessasary, because otherwise the make step will be executed every time you hit make.