Re: [QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Joerg Bornemann
On 07-Aug-14 15:14, Richard Weickelt wrote:

> Eureka! Thank You for explaining. I think, my problem is located in the
> definition of 'dependency' which seems to have a rather temporal meaning.
> Let me repeat in my own words what You have said: If foo.cpp includes foo.h,
> QBS detects a *dependency* between them through its built-in cpp-scanner.
> Dependency means: if foo.h is generated by a rule, QBS ensures, that foo.h
> is generated *before* foo.cpp is compiled. It does *not* add the output
> folder of foo.h to the includePath of foo.cpp. The latter is what I have
> expected and where the confusion comes from.
>
> Is this correct?

That's correct. :)


BR,

Joerg
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Richard Weickelt

>> What 'automatically' means then in the above paragraph? Does it mean
>> anything beyound "generated header files can be tagged and therefore serve
>> as dependencies for other rules"?
> 
> If there's a foo.cpp that includes foo.h and foo.h is generated by such a
> dyamic rule then a dependency from foo.cpp to foo.h is added. If the rule
> decides in a later build that foo.h is not generated anymore, then foo.h
> (and the dependency) is removed.
> That's basically what I tried to compress into the word "automatically".
> No magic, maybe even not worth mentioning, but an important automatism.

Eureka! Thank You for explaining. I think, my problem is located in the
definition of 'dependency' which seems to have a rather temporal meaning.
Let me repeat in my own words what You have said: If foo.cpp includes foo.h,
QBS detects a *dependency* between them through its built-in cpp-scanner.
Dependency means: if foo.h is generated by a rule, QBS ensures, that foo.h
is generated *before* foo.cpp is compiled. It does *not* add the output
folder of foo.h to the includePath of foo.cpp. The latter is what I have
expected and where the confusion comes from.

Is this correct?

Richard


-- 
Richard Weickelt
Jagowstraße 15
10555 Berlin
Germany

Tel:(+49) (0) 30 96 60 30 90
Fax:(+49) (0) 355 5 478 477 9
Mobil:  (+49) (0) 151 23347215
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Joerg Bornemann
On 07-Aug-14 12:55, Richard Weickelt wrote:

> What 'automatically' means then in the above paragraph? Does it mean
> anything beyound "generated header files can be tagged and therefore serve
> as dependencies for other rules"?

If there's a foo.cpp that includes foo.h and foo.h is generated by such 
a dyamic rule then a dependency from foo.cpp to foo.h is added. If the 
rule decides in a later build that foo.h is not generated anymore, then 
foo.h (and the dependency) is removed.
That's basically what I tried to compress into the word "automatically".
No magic, maybe even not worth mentioning, but an important automatism.


BR,

Joerg
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Richard Weickelt
Hi,

>>> Qbs now supports rules with a flexible number of outputs.  For example,
>>> you may write an IDL file containing the descriptions of several C++
>>> interfaces. An interface compiler generates a number of header files. The
>>> generated header files are automatically taken into account as potential
>>> dependencies.
>>
>> I stumbled over the word *automatically*. I know how to write custom
>> transformation rules in modules to generate header files, but I do not
>> understand how the generated header files would magically appear in
>> cpp.includePaths.
> 
> They don't appear magically in cpp.includePaths, and I have no clue how
> you've concluded this from the above paragraph.

That was my intention of "taking header files automatically into account as
potential dependencies".

>> From what I understand, I would have to define an extra product for
>> generated header files which anoher product can then depend on [1] or I
>> could use a fixed output folder, where all generated files are written to.
>> This output folder is then explicitly added to cpp.includePath. The latter
>> is done for ui files in [2] as well.
> 
> That's true. What exactly is your question?

What 'automatically' means then in the above paragraph? Does it mean
anything beyound "generated header files can be tagged and therefore serve
as dependencies for other rules"?

Richard




signature.asc
Description: OpenPGP digital signature
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Joerg Bornemann
On 07-Aug-14 11:45, Richard Weickelt wrote:

>> Qbs now supports rules with a flexible number of outputs.  For example,
>> you may write an IDL file containing the descriptions of several C++
>> interfaces. An interface compiler generates a number of header files. The
>> generated header files are automatically taken into account as potential
>> dependencies.
>
> I stumbled over the word *automatically*. I know how to write custom
> transformation rules in modules to generate header files, but I do not
> understand how the generated header files would magically appear in
> cpp.includePaths.

They don't appear magically in cpp.includePaths, and I have no clue how 
you've concluded this from the above paragraph.

> From what I understand, I would have to define an extra product for
> generated header files which anoher product can then depend on [1] or I
> could use a fixed output folder, where all generated files are written to.
> This output folder is then explicitly added to cpp.includePath. The latter
> is done for ui files in [2] as well.

That's true. What exactly is your question?


BR,

Joerg
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


[QBS] How to resolve dependencies on generated header files

2014-08-07 Thread Richard Weickelt
Hi,

my question related to QBS release post at
http://blog.qt.digia.com/blog/2014/05/05/qbs-1-2-0-released/

> Qbs now supports rules with a flexible number of outputs.  For example,
> you may write an IDL file containing the descriptions of several C++
> interfaces. An interface compiler generates a number of header files. The
> generated header files are automatically taken into account as potential
> dependencies.

I stumbled over the word *automatically*. I know how to write custom
transformation rules in modules to generate header files, but I do not
understand how the generated header files would magically appear in
cpp.includePaths.

>From what I understand, I would have to define an extra product for
generated header files which anoher product can then depend on [1] or I
could use a fixed output folder, where all generated files are written to.
This output folder is then explicitly added to cpp.includePath. The latter
is done for ui files in [2] as well.

[1] http://lists.qt-project.org/pipermail/qbs/2013-December/000591.html
[2]
https://qt.gitorious.org/qt-labs/qbs/source/src/lib/qtprofilesetup/templates/gui.qbs

Richard

___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs