Re: [Qbs] Including project files matching git submodules

2019-01-09 Thread Richard Weickelt

> But I have one more question: Is Project { references: [...] } the only way
> to include other files, apart from defining new modules?

Please specify "include other files". Did you want to say "include other
.qbs files into a project"?

If yes, then in addition to the 2 ways you mentioned, you could also extend
a Qbs language item and instanciate that somewhere in your project. See
http://doc.qt.io/qbs/custom-modules.html#custom-items and see
http://doc.qt.io/qbs/qbsconvenienceitems-qmlmodule.html for a list of
derived Product/Project items that are shipped with Qbs.

Richard
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Including project files matching git submodules

2019-01-04 Thread Björn Schäpers

Am 03.01.2019 um 22:36 schrieb Silvano Cerza:
I think it should be enough to delete up.qbs and remove references: 
["../up.qbs"] from lib2.qbs.

Obviously if you export cpp.includePaths you must export a dependency to cpp.

Il giorno gio 3 gen 2019 alle ore 22:17 Björn Schäpers > ha scritto:


Hi,

I'm trying to build a repository for multiple libraries and applications,
where
every product is located in an own submodule. Right now I'm at this point:

root/
- all.qbs
- libs/
   - libs.qbs
   - up.qbs
   - lib1/
     - lib1.qbs
   - lib2/
     - lib2.qbs

Lib2 needs lib1. The file contents are as follows (striped to what I think 
is
relevant):

lib1.qbs
Product {
   name: "Lib1"
   Export { cpp.includePaths: ["./include"] }
}

lib2.qbs
Project {
   references: ["../up.qbs"]
   Depends { name: "Lib1" }
}

up.qbs
Project { references: ["../all.qbs"] }

all.qbs
Project { references: ["libs/libs.qbs"] }

libs.qbs
Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }

Trying to compile lib2 I get the message "Cycle detected while referencing
file
'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator
did find
the headers for auto completion).

The message is clear, but not how do I solve this problem? I want the
libraries
to be able to use other libraries, without knowing their path, only their
name.
I'm willing to use something like my up.qbs here or maybe a function to
filter
out the current root qbs (in my case lib2.qbs) from the references list,
but I
don't know if this is possible and if how to do it. I have right now no
experience in QML/JS.

Can anybody help me, or show another solution to my problem?

Many thanks in advance,
Björn.

Yeah thanks, of course I had exported the cpp dependency, I just had used the 
library qbs files directly and not the root qbs. Now that I'm using the root qbs 
I don't need the up.qbs, right.
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Including project files matching git submodules

2019-01-04 Thread Björn Schäpers

Am 04.01.2019 um 10:21 schrieb Christian Kandeler:

On Thu, 3 Jan 2019 22:14:09 +0100
Björn Schäpers  wrote:


I'm trying to build a repository for multiple libraries and applications, where
every product is located in an own submodule. Right now I'm at this point:

root/
- all.qbs
- libs/
- libs.qbs
- up.qbs
- lib1/
  - lib1.qbs
- lib2/
  - lib2.qbs

Lib2 needs lib1. The file contents are as follows (striped to what I think is
relevant):

lib1.qbs
Product {
name: "Lib1"
Export { cpp.includePaths: ["./include"] }
}

lib2.qbs
Project {
references: ["../up.qbs"]
Depends { name: "Lib1" }
}

up.qbs
Project { references: ["../all.qbs"] }

all.qbs
Project { references: ["libs/libs.qbs"] }

libs.qbs
Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }

Trying to compile lib2 I get the message "Cycle detected while referencing file
'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator did find
the headers for auto completion).

The message is clear, but not how do I solve this problem? I want the libraries
to be able to use other libraries, without knowing their path, only their name.

Are you saying you want to be able to open a library project file in isolation 
(as opposed to the top-level project) and expect it to know everything else? If 
so, may I ask why? Obviously, you are relying on the entire project to be 
present anyway, so why not work with that one?


Christian


Yeah on my way to work today I thought I should open the root qbs.
So yes and no, I don't want to be able, until now I just hadn't thought about 
using it otherwise.


But I have one more question: Is Project { references: [...] } the only way to 
include other files, apart from defining new modules?


Björn.

___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Including project files matching git submodules

2019-01-04 Thread Christian Kandeler
On Thu, 3 Jan 2019 22:14:09 +0100
Björn Schäpers  wrote:

> I'm trying to build a repository for multiple libraries and applications, 
> where 
> every product is located in an own submodule. Right now I'm at this point:
> 
> root/
> - all.qbs
> - libs/
>- libs.qbs
>- up.qbs
>- lib1/
>  - lib1.qbs
>- lib2/
>  - lib2.qbs
> 
> Lib2 needs lib1. The file contents are as follows (striped to what I think is 
> relevant):
> 
> lib1.qbs
> Product {
>name: "Lib1"
>Export { cpp.includePaths: ["./include"] }
> }
> 
> lib2.qbs
> Project {
>references: ["../up.qbs"]
>Depends { name: "Lib1" }
> }
> 
> up.qbs
> Project { references: ["../all.qbs"] }
> 
> all.qbs
> Project { references: ["libs/libs.qbs"] }
> 
> libs.qbs
> Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }
> 
> Trying to compile lib2 I get the message "Cycle detected while referencing 
> file 
> 'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator did 
> find 
> the headers for auto completion).
> 
> The message is clear, but not how do I solve this problem? I want the 
> libraries 
> to be able to use other libraries, without knowing their path, only their 
> name. 

Are you saying you want to be able to open a library project file in isolation 
(as opposed to the top-level project) and expect it to know everything else? If 
so, may I ask why? Obviously, you are relying on the entire project to be 
present anyway, so why not work with that one?


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] Including project files matching git submodules

2019-01-03 Thread Silvano Cerza
I think it should be enough to delete up.qbs and remove references:
["../up.qbs"] from lib2.qbs.
Obviously if you export cpp.includePaths you must export a dependency to
cpp.

Il giorno gio 3 gen 2019 alle ore 22:17 Björn Schäpers <
qt-maill...@hazardy.de> ha scritto:

> Hi,
>
> I'm trying to build a repository for multiple libraries and applications,
> where
> every product is located in an own submodule. Right now I'm at this point:
>
> root/
> - all.qbs
> - libs/
>- libs.qbs
>- up.qbs
>- lib1/
>  - lib1.qbs
>- lib2/
>  - lib2.qbs
>
> Lib2 needs lib1. The file contents are as follows (striped to what I think
> is
> relevant):
>
> lib1.qbs
> Product {
>name: "Lib1"
>Export { cpp.includePaths: ["./include"] }
> }
>
> lib2.qbs
> Project {
>references: ["../up.qbs"]
>Depends { name: "Lib1" }
> }
>
> up.qbs
> Project { references: ["../all.qbs"] }
>
> all.qbs
> Project { references: ["libs/libs.qbs"] }
>
> libs.qbs
> Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }
>
> Trying to compile lib2 I get the message "Cycle detected while referencing
> file
> 'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator
> did find
> the headers for auto completion).
>
> The message is clear, but not how do I solve this problem? I want the
> libraries
> to be able to use other libraries, without knowing their path, only their
> name.
> I'm willing to use something like my up.qbs here or maybe a function to
> filter
> out the current root qbs (in my case lib2.qbs) from the references list,
> but I
> don't know if this is possible and if how to do it. I have right now no
> experience in QML/JS.
>
> Can anybody help me, or show another solution to my problem?
>
> Many thanks in advance,
> Björn.
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] Including project files matching git submodules

2019-01-03 Thread Björn Schäpers

Hi,

I'm trying to build a repository for multiple libraries and applications, where 
every product is located in an own submodule. Right now I'm at this point:


root/
- all.qbs
- libs/
  - libs.qbs
  - up.qbs
  - lib1/
- lib1.qbs
  - lib2/
- lib2.qbs

Lib2 needs lib1. The file contents are as follows (striped to what I think is 
relevant):


lib1.qbs
Product {
  name: "Lib1"
  Export { cpp.includePaths: ["./include"] }
}

lib2.qbs
Project {
  references: ["../up.qbs"]
  Depends { name: "Lib1" }
}

up.qbs
Project { references: ["../all.qbs"] }

all.qbs
Project { references: ["libs/libs.qbs"] }

libs.qbs
Project { references: ["lib1/lib1.qbs", "lib2/lib2.qbs"] }

Trying to compile lib2 I get the message "Cycle detected while referencing file 
'lib2/lib2.qbs'." And the Include-Path is not added (although QtCreator did find 
the headers for auto completion).


The message is clear, but not how do I solve this problem? I want the libraries 
to be able to use other libraries, without knowing their path, only their name. 
I'm willing to use something like my up.qbs here or maybe a function to filter 
out the current root qbs (in my case lib2.qbs) from the references list, but I 
don't know if this is possible and if how to do it. I have right now no 
experience in QML/JS.


Can anybody help me, or show another solution to my problem?

Many thanks in advance,
Björn.
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs