Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, June 2007
Simulating post-build steps


Message 1 in thread

Does QMake offer functionality similar to a post-build/post-linker step
in Visual Studio?

I wrote a custom qmake function to do the work for me, but it gets
called multiple times. I just want this to get called once, and ONLY
after the project has been successfully compiled.

> Mike C

--
 [ signature omitted ] 

Message 2 in thread

Hi Mike,


> Does QMake offer functionality similar to a post-build/post-linker step
> in Visual Studio?
> 
> I wrote a custom qmake function to do the work for me, but it gets
> called multiple times. I just want this to get called once, and ONLY
> after the project has been successfully compiled.

Have a look at the section "Customizing Makefile Output" in the qmake
manual. I think it describes what you are trying to achieve:


qmake tries to do everything expected of a cross-platform build tool.
This is often less than ideal when you really need to run special
platform-dependent commands. This can be achieved with specific
instructions to the different qmake backends.

Customization of the Makefile output is performed through an
object-style API as found in other places in qmake. Objects are defined
automatically by specifying their members; for example:

 mytarget.target = .buildfile
 mytarget.commands = touch $$mytarget.target
 mytarget.depends = mytarget2
 mytarget2.commands = @echo Building $$mytarget.target

The definitions above define a qmake target called mytarget, containing
a Makefile target called .buildfile which in turn is generated with the
touch command. Finally, the .depends member specifies that mytarget
depends on mytarget2, another target that is defined afterwards.
mytarget2 is a dummy target; it is only defined to echo some text to the
console.

The final step is to instruct qmake that this object is a target to be
built:

 QMAKE_EXTRA_TARGETS += mytarget mytarget2


\Ral

--
 [ signature omitted ] 

Message 3 in thread

Mike Corredera <mecorr@xxxxxxxxxxxx> wrote on 06/20/2007 07:24:58 AM:

# Does QMake offer functionality similar to a post-build/post-linker step
# in Visual Studio?
#
# I wrote a custom qmake function to do the work for me, but it gets
# called multiple times. I just want this to get called once, and ONLY
# after the project has been successfully compiled.

Have you tried QMAKE_POST_LINK?

--
 [ signature omitted ] 

Message 4 in thread

Mike Corredera schrieb:
> Does QMake offer functionality similar to a post-build/post-linker step
> in Visual Studio?

You may want to use QMAKE_PRE_LINK. See Tasttracker # 150961; seems like 
it's been added in 4.3.

Martin

-- 
 [ signature omitted ]