[Qt-interest] Makefile rules in .pro file?
Phil Dumont
phil at solidstatescientific.com
Fri Aug 5 19:16:58 CEST 2011
I've got it working *almost* perfectly.
My .pro file looks something like this:
QT -= gui
TARGET = myapp
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += myapp.cpp
HEADERS += myapp.h \
myapp_gen.h
gensrc.target = myapp_gen.h
gensrc.depends = gen_header.py myapp.ini
gensrc.commands = gen_header.py
QMAKE_EXTRA_TARGETS += gensrc
PRE_TARGETDEPS += myapp_gen.h
The only thing keeping me from being completely happy is, when I run qmake,
it complains thusly:
WARNING: Failure to find: myapp_gen.h
Ordinarily, qmake complaining about a missing header would be good. But
under current circumstances, not so much. Is there any way to turn it off?
Alternatively, I could throw a message() in the .pro file that tells the
next person to build the project (maybe even me, after I've had long enough
to forget) that the ominous looking message is nothing to worry about. But
that wouldn't be quite a clean.
Anyway, despite the warning, the Makefile is generated, and does the right
thing.
phil
On Fri, Aug 5, 2011 at 12:31 PM, Phil Dumont
<phil at solidstatescientific.com>wrote:
> After hitting send, I looked just a little more... Looks like
>
> http://doc.trolltech.com/4.7/qmake-environment-reference.html#customizing
>
> might be what I'm looking for.
>
> phil
>
>
> On Fri, Aug 5, 2011 at 12:02 PM, Phil Dumont <
> phil at solidstatescientific.com> wrote:
>
>> Hi all,
>>
>> I'm starting on a Qt project where one of the source files (a header) is
>> going to be generated by a script. I would like a rule in my Makefile that
>> runs the script when the target is missing or older than it's dependencies.
>> I've looked quite a lot through qmake documentation, but have been unable
>> to find what to put in my .pro file to get this done. Any help?
>>
>> Thanks,
>> phil
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110805/12cab36a/attachment.html
More information about the Qt-interest-old
mailing list