On Wed, 17 Jul 2019 23:25:49 +0800
Vincent Hui <[email protected]> wrote:

> I want to check whether a project is a subproject of another project. If a
> project is not a subproject, its examples and tests are built. If a project
> is a subproject, its examples and tests are not built.

Declare a property in your project that controls this. Override this property 
from the containing project. Done.

> It seems that the method for checking whether a project is a subproject is
> undocumented.

There is no such method, and I don't think it would be a good idea to have it.

> I came up with a method to check whether a project is a subproject. It is
> checking whether  sourceDirectory is equal to path. I tried a simple
> project, my method works.
> 
> "
> Project {
>     readonly property bool isSubProject: (sourceDirectory === path) ? false
> : true;
> ......
> "
> 
> Can my method work in complicated projects?

No. The parent project could be in the same directory.


Christian
_______________________________________________
Qbs mailing list
[email protected]
https://lists.qt-project.org/listinfo/qbs

Reply via email to