Home · Overviews · Reference · Classes |
The depends extension provides two interfaces for inter-project dependencies.
Projects can influence their dependants by creating depends objects.
OBJECT.TYPE=DEPENDS OBJECT.EVAL="FOO*=bar"
You can use the following TYPE modifiers to affect how depends objects work.
Only projects directly depending on this project will process this dependency.
This dependency will be written to the module.dep file so that it can be processed when this project does not exist.
This PERSISTED dependency will be exported to the SDK. Most PERSISTED rules want to be exported to the SDK but any rules referencing paths in the build or source trees cannot be exported (as those paths will not exist when the SDK is deployed).
This dependency will also be processed by the project it was declared in.
Projects register their dependencies with the DEPENDS variable or with the MODULES variable.
DEPENDS=/solution/path/to/other_project MODULES=other_project
The advantage of MODULES is that you do not need to know the exact location of the other project and you can use the project even if it does not exist (which is the case when you depend on a project in an SDK). If you depend on a module and it does not exist the project tree will be searched and if the module is found your project will do an immediate DEPENDS-style load of the other project. This allows greater parallelization when building. Note that extra dependencies will be inserted in this case to ensure things aren't built out of order.
Note that some variables set by another project will be automatically imported into your project due to the DEPENDS.AUTO_PERSIST variable. This is currently used by the qt and qtopia extensions to let QT and QTOPIA values get inherited.
The .EVAL object is considered to be a list of statements that are evaluated by dependant projects.
OBJECT.TYPE=DEPENDS OBJECT.EVAL=\ "FOO=foo bar" "BAR=""foo bar"""\ "contains(FOO,foo):message(FOO)"\ "contains(BAR,foo):message(BAR)"
This equates to the following code:
FOO=foo bar BAR="foo bar" contains(FOO,foo):message(FOO) contains(BAR,foo):message(BAR)
Note how the quotes were handled. Individual strings are interpreted as lines. Embedded quotes become quotes. This makes the first test true and the second test false.
DEPENDS | |
---|---|
DEPENDS.AUTO_PERSIST | |
MODULES | |
MODULE_NAME |
See also QBuild Extensions and QBuild Script.
Copyright © 2009 Trolltech | Qt Extended - QBuild Maintainer Guide |