aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-01-08 17:02:35 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-01-08 18:10:48 +0100
commit43d76eb04f174ef4ed5b5681799250ff17340c11 (patch)
tree9d07719f72cc59929333c6a942322ab443d35ac7 /doc
parent4a9bf0c6b481039bc4a7cbf5aa3fc2da47d4987f (diff)
Add support for soft dependencies.
Depends items get a "required" property, module presence can be checked via "present" property. Change-Id: Id188a442b3b32c5b2e50e568e59cee074774f125 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/items/depends.qdoc8
-rw-r--r--doc/reference/items/module.qdoc26
2 files changed, 32 insertions, 2 deletions
diff --git a/doc/reference/items/depends.qdoc b/doc/reference/items/depends.qdoc
index 1bb7c0142..6ace42a3f 100644
--- a/doc/reference/items/depends.qdoc
+++ b/doc/reference/items/depends.qdoc
@@ -53,6 +53,14 @@
\li true
\li Determines whether the dependency will actually be applied.
\row
+ \li required
+ \li bool
+ \li \c true
+ \li Setting this property to \c false creates a "soft dependency", meaning that it is not
+ considered an error if the given module cannot be found. In such a case, an instance of
+ the respective module will be created, but only the \c present property will be
+ available for querying, and it will be set to \c false.
+ \row
\li name
\li string
\li undefined
diff --git a/doc/reference/items/module.qdoc b/doc/reference/items/module.qdoc
index 0cc7707b9..35ef659cf 100644
--- a/doc/reference/items/module.qdoc
+++ b/doc/reference/items/module.qdoc
@@ -40,11 +40,26 @@
product if the product depends on (or loads) the module.
A Module can be loaded by adding a dependency to it in a product.
- For example, the following product will load the \c cpp module:
+ For example, the following product will load the \c cpp module. In addition, it will try
+ to load modules that may or may not exist, and in the latter case use a fallback.
\code
Product {
Depends { name: "cpp" }
- ...
+ Depends {
+ name: "awesome_module"
+ required: false
+ }
+ Depends {
+ name: "adequate_module"
+ condition: !awesome_module.present
+ required: false
+ }
+ Depends {
+ name: "crappy_module"
+ condition: !awesome_module.present && !adequate_module.present
+ }
+
+ // ...
}
\endcode
@@ -55,6 +70,13 @@
\li Default
\li Description
\row
+ \li present
+ \li bool
+ \li \c true
+ \li This property is read-only. Its value is \c false if and only if the respective
+ \c Depends item had its \c required property set to \false and the module was
+ not found.
+ \row
\li setupBuildEnvironment
\li script
\li \c undefined