[QBS] Qt mailing list migration

2015-03-16 Thread Järvenpää Petri
Hello,
We are migrating the mailing list server on Wednesday 18th of March around 
09:00 EET.
The change should be invisible to the normal user, but maintenance break of 
some sort is always possible.

If you notice problems afterwards or have questions please contact : 
mika.hiekkam...@digia.com and petri.jarven...@digia.com
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


[QBS] Qt Plugin with QBS

2015-03-16 Thread at-2500
Hi,

I am trying to set up a project using the Qt Plugin System. The project 
consists of multiple binaries, one dynamic library that defines the Q_INTERFACE 
(LIB) and multiple plugins (PLUGIN) implementing this interface. To have common 
unit tests for all plugins, I have a gtest-based binary that loads and tests 
the plugins via their interface. This binary should only get linked to LIB, not 
to PLUGINS, which is why I removed the „dynamiclibrary“ tag, and added a new 
tag, „plugin“ for PLUGINS. Now, of course, my plugin will not be build because 
there is no rule cpp,hpp - plugin. Is there an easy way to call the prepare 
script of the cpp rules that would be active for a dynamic library? Something 
like prepare: cpp.compiler.prepare? Or is there a better way to achieve what I 
want?

I am probably not the only person trying to create a plugin, maybe it would 
make sense to add such a plugin type to QBS.cpp or qt_plugin to QBS.Qt? Or is 
there already something like this?

plugin1.qbs:

Product {
name: „PLUGIN1“
type: „plugin“

Depends {name: „cpp“}

Depends { name: „LIB“ }

Rule {
id: mycompiler
inputs: [cpp]
auxiliaryInputs: [hpp]

Artifact {
fileTags: [„plugin]
filePath: product.name + .so
}

prepare: compiler.prepare
}
}

test.qbs

CppApplication {
type: [application, copied_plugins]
name: PluginTester

Depends { name: cpp }
cpp.systemIncludePaths: [ /usr/src/gtest/ ]

Depends { name: „LIB }
Depends { name: „PLUGIN1 }

files: [ main.cpp ]

Rule {
id: plugin_copy

// take outputs of projects this product depends on, if they are of 
type plugin
// as input to this rule
usings: [„plugin]

Artifact {
fileTags: [ copied_plugins ]
filePath: input.fileName
}

prepare: {
var args = []
args.push(--symbolic-link)
args.push(input.filePath)
args.push(output.filePath)

var cmd = new Command(cp, args)
cmd.description = creating symlink for  + input.fileName +  
to PluginTester
return cmd;
}

}

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


Re: [QBS] Qt Plugin with QBS

2015-03-16 Thread Joerg Bornemann
On 16-Mar-15 13:12, at-2500 wrote:

 I am trying to set up a project using the Qt Plugin System.

The basic setup to create a Qt plugin is
   - create a product of type dynamiclibrary
   - add a JSON file and tag it with qt_plugin_metadata

 The project consists of multiple binaries, one dynamic library that defines 
 the Q_INTERFACE (LIB) and multiple plugins (PLUGIN) implementing this 
 interface. To have common unit tests for all plugins, I have a gtest-based 
 binary that loads and tests the plugins via their interface. This binary 
 should only get linked to LIB, not to PLUGINS, which is why I removed the 
 „dynamiclibrary“ tag, and added a new tag, „plugin“ for PLUGINS. Now, of 
 course, my plugin will not be build because there is no rule cpp,hpp - 
 plugin. Is there an easy way to call the prepare script of the cpp rules that 
 would be active for a dynamic library? Something like prepare: 
 cpp.compiler.prepare? Or is there a better way to achieve what I want?

This use case is independent from Qt plugins.
Unfortunately there's currently not a good way to call the compiler's 
prepare script again. See also QBS-5.

What you can do instead is something like this

DynamicLibrary {
 name: PLUGIN1
 Depends {name: „cpp“}
 Depends {name: „LIB“}
 files: [...all cpp files for building the plugin...]
}

Product {
 name: PLUGIN1_LINK
 type: [plugin_link]
 Depends {name: „PLUGIN1“}
 // Rule to create the symlink for a plugin.
 // Use inheritance to avoid code duplication.
}

And then let plugintester depend on the PLUGIN*_LINK products.


BR,

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