[QBS] Setting up the run environment in QtCreator
Joerg Bornemann
joerg.bornemann at digia.com
Tue Jun 3 15:18:07 CEST 2014
On 03-Jun-14 08:54, Thomas Epting wrote:
> class QBS_EXPORT RunEnvironment
> { ...
> const QProcessEnvironment runEnvironment() const;
> const QProcessEnvironment buildEnvironment() const;
>
> The implementations call setupXxxEnvironment of the resolvedProduct and
> return the created environment. Note that the second method is not
> strictly needed, but I thought it would be nice to have it also. If
> there is a better way to get the environments, please correct me ;-)
That's OK for now. Ideally, Qt Creator would use
RunEnvironment::runTarget to run the application. But the infrastructure
isn't fit for that yet.
So enhancing the API is in order IMO.
> Next, I tried to implement the missing functionality like this.
>
> void QbsRunConfiguration::addToBaseEnvironment(Utils::Environment &env)
> const
> {
[...]
> QtSupport::BaseQtVersion *qtVersion =
> QtSupport::QtKitInformation::qtVersion(target()->kit());
> if (qtVersion)
>
> env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS"));
> }
I wonder why the QT_INSTALL_LIBS part is needed. This should be done by
the setupRunEnvironment script in the Qt.core module. There seems to be
something amiss there. Not in your code - in the plugin or qbs itself.
BR,
Joerg
More information about the Qbs
mailing list