[QBS] Depends and cpp.includePaths

Joerg Bornemann joerg.bornemann at nokia.com
Mon Feb 27 11:42:04 CET 2012


On 24/02/2012 20:51, ext Ruslan Nigmatullin wrote:
> Modules and Products have different behaviour in context of Depends, i.e Module sets all needed variables like cpp.includePath automatically, but Product doesn't. Should user worry if he uses currently external library or built-in one? Is there any possibility to explicitly set for every dependant Product all needed variables?

The reason is that the properties you set in a Product are for 
_building_ the product. If you want to _use_ the product, you must 
specify a ProductModule and set the properties you need.

> For example there are lots of cpp.includePaths in every QtCreator's plugin with hard-coded relative path to core libraries, so it's quietly impossible to build them as standalone package. Also all this qbs files have to be fixed in case of moving plugins' directory somewhere to other place.

This should be moved to the ProductModule in src/plugins/core.qbs then.

> May be library products should be available to be implemented in such way:
>
> DynamicLibrary {
>      name: "mylib"
>
>      // Some additional data to be set for dependant products
>      // Suggest that path to library is already set automatically
>      ProductModule {
>          Depends { "name": "cpp" }
>          cpp.includePath: [ product.path ]
>      }
> }

I actually would like to keep DynamicLibrary free of the cpp module.
One could have something like

---CppDynamicLibrary.qbs---
Product {
     type: "dynamiclibrary"
     Depends { name: 'cpp' }
     ProductModule {
         Depends { name: 'cpp' }
         // useful default properties
     }
}

Also, what is product.path? The source dir of the product? That would be 
just ".". Many projects do not put their source files into the same 
directory as the project file is in. So I'm not sure how valuable this 
default actually is.



BR,

Jörg



More information about the Qbs mailing list