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

Add a global option

Put this in the optvar section of configure.

    set_optvar( "myopt", +{
        "set" => [ "%", "Enable myopt." ],
        "unset" => [ "no-%", "Disable myopt." ],
        "default" => 1,
        "visible" => $qtopia_visref,
        "autodep" => $qtopia_autoref,
        "config_pri" => "CONFIG+=enable_myopt",
    });

Note the use of a positively-worded option. It is much easier to figure out what code does when the options are positively worded.

If you want defines for testing in code, put this in a suitable place (defaults.js is typical for global stuff).

    # positive define (preferred)
    enable_myopt:DEFINES+=QTOPIA_MYOPT
    # negative define (to match the QT_NO_ style)
    !enable_myopt:DEFINES+=QTOPIA_NO_MYOPT

See also Tasks and Opt System.


Copyright © 2009 Trolltech
Qt Extended - Build System Documentation