Qt Extended Home · Build System Home · Reference · User Guide · Internals codeless banner

Override Commands

You can override qmake-generated targets by naming them specially. The exception to this is the all target. The structure is redirect_<target>.

    redirect_clean.commands=@echo overriding the clean target
    QMAKE_EXTRA_TARGETS+=redirect_clean

The all target can't be overridden but you can trigger a command to run at that time. This is mostly useful for stub projects since they don't build anything.

    redirect_all.commands=@echo redirect_all
    ALL_DEPS+=redirect_all

There are some commands you can't override.

    mytarget.commands=@echo regenerating
    QMAKE_EXTRA_TARGETS+=mytarget
    regenerate.depends+=mytarget

See also Advanced Tasks.


Copyright © 2009 Nokia
Qt Extended - Build System Documentation