PDA

View Full Version : Make qmake just run arbitrary shell command then finish?



33333
26th June 2014, 13:33
Hi

I have a subdirs build, and in one subdir I just want to run an arbitrary shell script. No compiling, it would be just a *really* simple makefile. How can I do this?

FYI This question is academic. I'm testing how subdirs works and I just want test stubs that succeed and print "~Hello", instead of telling me they can't find a main()... Still it might be useful too.

Thanks.

anda_skoa
26th June 2014, 13:49
Maybe this will help http://www.qtcentre.org/wiki/index.php?title=Undocumented_qmake#Custom_tools

Cheers,
_

33333
27th June 2014, 00:36
I figured out a couple of solutions. At first I tried this:

TARGET = foo
foo.commands = echo foo

Which seem logical to me but does not override the built-in auto generated target rules. Its seems qmake stubbornly refuses to not to be a compiler of stuff - which is quite annoying. But this gets around it, just printing a warning:

TARGET = foo
foo.commands = echo foo
QMAKE_EXTRA_TARGETS += foo

You could also use

REQUIRES = VARIABLE_THAT_DNE

to make the qmake succeed with a warningn message.