Qbs Manual

Qbs 1.16.0

# Exporter.qbs

Provides support for generating Qbs modules from products. More...

Since: | Qbs 1.12

- List of all members, including inherited members

## Properties

- additionalContent : string
- artifactTypes : stringList
- excludedDependencies : stringList
- fileName : string

## Detailed Description

The Exporter.qbs module contains the properties and rules to create a Qbs module from the Export item of a Product.

Such a module acts as your product's interface to other projects written in Qbs. For instance, suppose you are creating a library. To allow other products both within and outside of your project to make use of it, you would write something like the following:

      DynamicLibrary {
          name: "mylibrary"
          qbs.installPrefix: "/opt/mylibrary"
          Depends { name: "Exporter.qbs" }
          property string headersInstallDir: "include"
          // ...
          Group {
              name: "API headers"
              files: ["mylib.h"]
              qbs.install: true
              qbs.installDir: headersInstallDir
          }
          Group {
              fileTagsFilter: ["Exporter.qbs.module"]
              qbs.installDir: "qbs/modules/mylibrary"
          }
          Export {
              Depends { name: "cpp" }
              cpp.includePaths: [product.sourceDirectory]
              prefixMapping: [{
                      prefix: product.sourceDirectory,
                      replacement: FileInfo.joinPaths(qbs.installPrefix, product.headersInstallDir)
                  }]
          }
      }

To build against this library, from within your project or any other one, you simply declare a dependency:

      Depends { name: "mylibrary" }

### Relevant File Tags

Tag | Since | Description
--- | --- | ---
`"Exporter.qbs.module"` | 1.12.0 | This tag is attached to the generated module file.

## Property Documentation

additionalContent : string

The value of this property will be copied verbatim into the generated module.

Default: `undefined`

artifactTypes : stringList

Artifacts that match these tags will become target artifacts of the generated module, so they can get picked up by the rules of depending products.

If you do not specify anything here, all installed artifacts of the product are considered.

Note: You can only limit the default set of artifacts by setting this property, but you cannot extend it, because only artifacts that are to be installed are considered.

Default: `undefined`

excludedDependencies : stringList

Normally, all Depends items in the Export item are copied into the generated module. However, if there are any exported dependencies that only make sense for products in the same project, then you can enter their names into this array, and they will get filtered out.

Note: You should strive to structure your projects in such a way that you do not need to set this property.

Default: `undefined`

fileName : string

The name of the generated module file.

Default: `product.targetName + ".qbs"`