Qbs Manual | Probe Item

Qbs 1.10.1

Parameters Item ◦ Product Item

# Probe Item

`Probe` items can appear inside products and projects. They are run prior to building, for instance to locate dependent headers, libraries, and other files outside the project directory whose locations are not known ahead of time. Probes can be parameterized via their properties and typically store results in properties as well. These results are then retrieved via the Probe's id, which is mandatory:

      Product {
          Probe {
              id: valueCalculator
              property string parameter: "whatever"
              property int value
              configure: {
                  value = Utils.calculateValue(parameter); // Expensive operation
                  found = true;
              }
          }
          property int theValue: valueCalculator.value
      }

Note: Because Probes often invoke external processes, which is relatively expensive compared to evaluating normal properties, their results are cached. To force re-evaluation of a Probe, you can supply the `--force-probe-execution` command-line option.

## Probe Properties

Property | Type | Default | Description
--- | --- | --- | ---
condition | bool | true | Determines whether the probe will actually be run.
found | bool | undefined | Indicates whether the probe was run successfully. Set by `configure`.
configure | script | undefined | Script that is executed when the probe is run.

Parameters Item ◦ Product Item