not all dependencies need to be actually linked into the Product:
- a module may be needed at runtime only
- generic libraries (in qt: opengl, openssl, ...)
- plugins (including qml modules)
- such dependencies would be forwarded to Exports (see QBS-584), to make sure exported Rules (see
QBS-583) are not executed too early
- such dependencies would be also used for deployment
- as a special variation, a library may be loaded only at runtime, but its include path needs to be added to the compiler call
a dependency can be principally parametrized from four locations:
- the hard-coded default behavior of the Rules
- said behavior may depend on a Parameter. that parameter may be set in several places:
- in Products which Export Modules, and by extension in Modules themselves. i.e., the imported Module requests how it shall be used (by default).
- in Depends items which import Modules. i.e., the importing Product explicitly specifies how the imported Module shall be used (overrides default)
- in DefaultParameters items which override the imported Modules' defaults in the importing Products' scope, and can be still overridden by the Depends items.
- these items shall have an optional productTypes property which limits to which imported Modules these parameters should apply, e.g. only plugins.
first declare the parameter itself:
then create a Module which sets a default for a parameter:
this results in an exported Module:
then use the parameter in different ways:
also, static plugins need to be actually linked. this will typically also require auto-generating static initializers for the plugins' factory methods. this is framework-dependent, so it would end up in a QtPlugin item.