Export Item

An Export item can appear inside a Product Item. It defines a Module with the product's name that can be depended on by other products. The properties attached to the Export item will take effect in all products that depend on the product inside which the Export item is defined. As an example, consider these two products:

Product {
    name: "A"
    Export {
        Depends { name: "cpp" }
        cpp.includePaths: product.sourceDirectory
        cpp.defines: ["USING_" + product.name.toUpperCase()]
    }
}

Product {
    name: "B"
    Depends { name: "A" }
}

The sources in product B will be able to use headers from product A without specifiying the full path to them, because the include path has been made known to the compiler via A's Export item. Additionally, product B will be compiled with the define USING_A.

Note: This relationship is transitive, so a product C depending on product B will also get the include paths and preprocessor macros via A's Export item.

In contrast to Module items, product within Export items refers to the product which defines the Export item. Use the importingProduct variable to refer to the product that pulls in the resulting module.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.