Re: [QBS] static library dependency always recompiles

2015-09-30 Thread Richard Weickelt
> i'm trying now to set the library in cpp.staticLibraries or directly the
> full path to the .a as a cpp.linkerFlags but the project won't detect if
> the library has changed.

Shouldn't you use cpp.libraryPaths instead of cpp.linkerFlags?

> if i modify the library and recompile it, then run the project it will
> just run as if nothing had changed, it won't link the new version of the
> library.

Seems, that external libraries' modification dates are not properly tracked.

> is there any way to set a file as a dependency with the cpp module? so
> when it changes the project recompiles or relinks?

I would consider this a bug or at least a missing feature. You should
definitely create a ticket here: https://bugreports.qt.io/browse/QBS
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] static library dependency always recompiles

2015-09-30 Thread arturo castro
i'm trying now to set the library in cpp.staticLibraries or directly the
full path to the .a as a cpp.linkerFlags but the project won't detect if
the library has changed.

if i modify the library and recompile it, then run the project it will
just run as if nothing had changed, it won't link the new version of the
library.

is there any way to set a file as a dependency with the cpp module? so
when it changes the project recompiles or relinks?
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] static library dependency always recompiles

2015-09-30 Thread arturo castro
Yes i already have a module that exports all the search paths and other
flags common to the library and applications using it.

To explain better the use case, the library i develop has around 200
examples, every time a user wants to compile one the library has to be
compiled already otherwise having it as a dependency would recompile the
library every time.

That would be fine for most users but people developing the project
usually do modifications to the library itself while developing
applications so it's really handy that just by running the application
it'll recompile whatever has changed in the library too. Otherwise it's
really easy to run an application without having recompiled the library
first to find that the changes you've just done are not there, which can
become super confusing.

With every other ide we use (visual studio, codeblocks, xcode and plain
makefiles) we have the option to do this, qmake also allows to do this.

Indeed with qtcreator you can open a project and the library it depends
on, set one project to be dependent on another (through the projects >
dependencies view, not as a qbs dependency) and it'll do what i'm
expecting but as soon as i close the projects that setting is lost.

I guess i'm looking for something similar to a visual studio solution
where you can open several projects but all of them keep their settings
and recompile in their own place so if a library is a dependency to more
than one project once it's compiled it won't recompile in another
solution except for any change.



On 30.09.2015 12:33, Richard Weickelt wrote:
>> I develop an open source library which i also use in my projects. I have
>> created a qbs project for my applications that has the library's qbs as
>> a dependency, using reference. The problem is that whenever i start a
>> new application it recompiles the library completely.
>>
>> Instead of recompiling every time i create a new application i would
>> like for the library to always compile in the same folder. So if i
>> create a new project the library is already compiled. That way i don't
>> end up with a lot of copies of the library's .o in every application
>> that depends on it.
> 
> By "start a new application" you mean, "create a new application project in
> a new folder"? What You observe, is the intended behaviour. AFAIK, you have
> two options.
> 
> 1) Create a single root project and define every application and Your
> library as product within that project or reference them as sub projects.
> When building the root project, every product is only built once.
> 
> 2) Don't reference Your library within qbs as a project, but build it
> separately and install it to some folder on Your system. In Your application
> products You would then load it via cpp.staticLibraries and reference
> necessary header files by cpp.includePaths
> 
> If Your library exports additional implications, like linker flags etc., You
> might want to generate a custom qbs module for it as well. This serves as a
> replacement for traditional pkg-config files. More infos about custom
> modules: http://doc.qt.io/qbs/custom-modules.html
> A (complicated) example are the Qt libaries. Maybe somebody can come up with
> a much simpler example project.
> 
> For what I understand, these are the intended use cases of qbs.
> ___
> QBS mailing list
> QBS@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
> 
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] static library dependency always recompiles

2015-09-30 Thread Richard Weickelt
> I develop an open source library which i also use in my projects. I have
> created a qbs project for my applications that has the library's qbs as
> a dependency, using reference. The problem is that whenever i start a
> new application it recompiles the library completely.
>
> Instead of recompiling every time i create a new application i would
> like for the library to always compile in the same folder. So if i
> create a new project the library is already compiled. That way i don't
> end up with a lot of copies of the library's .o in every application
> that depends on it.

By "start a new application" you mean, "create a new application project in
a new folder"? What You observe, is the intended behaviour. AFAIK, you have
two options.

1) Create a single root project and define every application and Your
library as product within that project or reference them as sub projects.
When building the root project, every product is only built once.

2) Don't reference Your library within qbs as a project, but build it
separately and install it to some folder on Your system. In Your application
products You would then load it via cpp.staticLibraries and reference
necessary header files by cpp.includePaths

If Your library exports additional implications, like linker flags etc., You
might want to generate a custom qbs module for it as well. This serves as a
replacement for traditional pkg-config files. More infos about custom
modules: http://doc.qt.io/qbs/custom-modules.html
A (complicated) example are the Qt libaries. Maybe somebody can come up with
a much simpler example project.

For what I understand, these are the intended use cases of qbs.
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


[QBS] static library dependency always recompiles

2015-09-30 Thread arturo castro
Hi

I develop an open source library which i also use in my projects. I have
created a qbs project for my applications that has the library's qbs as
a dependency, using reference. The problem is that whenever i start a
new application it recompiles the library completely.

Instead of recompiling every time i create a new application i would
like for the library to always compile in the same folder. So if i
create a new project the library is already compiled. That way i don't
end up with a lot of copies of the library's .o in every application
that depends on it.

With qmake i can do that but qbs doesn't allow to specify the build
directory.

I've also tried to include the library project as a subproject instead
of a reference in hope that that would make the library project
recompile in it's own build directory but it always recompiles all the
objects in the application build directory.

In qtcreator there's this option to set a project as a dependency of
another, and that kind of works but that setting is lost when the
projects are closed.

Is there anyway around this?

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