Qbs Manual

Qbs 1.13.1

# PathProbe QML Type

Locates files outside the project. More...

Import Statement: | import
Inherited By: | BinaryProbe, FrameworkProbe, and IncludeProbe

- List of all members, including inherited members

## Properties

- candidatePaths : stringList
- environmentPaths : stringList
- fileName : string
- filePath : string
- nameFilter : script
- nameSuffixes : stringList
- names : stringList
- path : string
- pathSuffixes : stringList
- platformEnvironmentPaths : stringList
- platformSearchPaths : pathList
- searchPaths : pathList

## Detailed Description

Finds files that have the specified file name suffix, such as .exe, from the specified locations.

PathProbe takes as input lists of paths to search files from and file name patterns. The paths are specified by using the searchPaths, platformSearchPaths, environmentPaths, and platformEnvironmentPaths properties. The file name patterns are specified by the names and nameSuffixes properties. Returns the first file that matches the file name patterns. If no such file is found, the probe.found property is set to `false`.

For example, a simple PathProbe that searches for the stdio.h header can be used as follows:

      Product {
          Depends { name: "cpp" }
          PathProbe {
              id: probe
              pathSuffixes: ["include"]
              names: ["stdio.h"]
          }
          cpp.includePaths: probe.found ? [probe.path] : []
      }

## Property Documentation

candidatePaths : stringList

This property contains the result list of all paths that were checked before a file was found (including the file names).

Default: Undefined

environmentPaths : stringList

The list of environment variables that contains paths where to search files. Paths in the environment variable should be separated using qbs.pathListSeparator.

Default: Undefined

fileName : string

This property contains the found file's name (excluding the path).

Default: Undefined

filePath : string

This property contains the full path to the found file, including the file name.

Default: Undefined

nameFilter : script

A script that is executed for each file name before prepending file suffixes. Can be used to transform file names.

nameSuffixes : stringList

The list of file suffixes to search for. These suffixes are appended to every file name passed via the names property. If names is empty, the probe looks for any file that ends with the given suffix.

Default: Undefined

names : stringList

The list of file names to search for.

Default: Undefined

path : string

This property contains the full path where the found file is located (that is, the file directory).

Default: Undefined

pathSuffixes : stringList

A list of relative paths that are appended to each path where PathProbe searches for files. That is, the file should be located within one of the subfolders passed using this property.

Default: Undefined

platformEnvironmentPaths : stringList

The list of platform environment variables that contains paths where to search files. Paths in the environment variable should be separated using qbs.pathListSeparator.

Default: Undefined

platformSearchPaths : pathList

The list of platform paths where to search files.

Default: `['/usr', '/usr/local']` on Unix hosts, empty otherwise

searchPaths : pathList

The list of paths where to search files.

Default: Undefined