Group Item Probe Item

# Module Item

A `Module` item is a collection of properties and language items that are used for building a 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 `cpp` module. In addition, it will try to load modules that may or may not exist, and in the latter case use a fallback.

    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
        }

        // ...
    }

Property | Type | Default | Description
--- | --- | --- | ---
present | bool | `true` | This property is read-only. Its value is `false` if and only if the respective `Depends` item had its `required` property set to `false` and the module was not found.
setupBuildEnvironment | script | `undefined` | Script for setting up the environment in which the project is built. Use the `putEnv` and `getEnv` functions to alter the environment. The return value of this script is ignored.
setupRunEnvironment | script | `setupBuildEnvironment` | Script for setting up the environment in which the project is run.
validate | script | `undefined` | Script that is run after the module is loaded. It can be used to check property values and throw errors in unexpected cases. The return value is ignored.

Group Item Probe Item