[Qt-creator] CppTools::ProjectInfo project sources and include paths

Roman Nikiforov roman at nikiforoff.de
Tue Feb 3 17:11:51 CET 2015


Hi Nikolai & Daniel,
thanks for your answers. For my plugin it would be better to get files and
include paths for selected configuration, not just all for the active
project. Sources of selected configuration create final binary, so it has
sence to check only these files.
@Daniel: Could you please point me to the prived methods you have to get
active sources? I coud than build custom version of qtcreator for the first
time and make them public in this version.

On Tue, Feb 3, 2015 at 3:32 PM, Daniel Teske <Daniel.Teske at theqtcompany.com>
wrote:

> On Tuesday 03 Feb 2015 15:29:48 Nikolai Kosjar wrote:
> > Hi!
> >
> > On Mon, 02. Feb 16:51, Roman Nikiforov wrote:
> > > The problem is that if I have conditions in qmake .pro file and some
> > > sources and include paths are added only for special configuration, I
> > > still
> > > get all source files from ProjectInfo, but include paths only for
> active
> > > configuration. Consequently Lint cannot resolve some includes and stops
> > > with error.
> >
> > At the end of the day, your observation describes what the code model
> > needs. All project files are passed in so they can be indexed (as far
> > as possible) so that their symbols show up in the locator or e.g.
> > "Search Symbols". Providing more include paths than for the current
> > build configuration could lead to subtle/unexpected side effects.
> >
> > Note that in general you can't just assume that a project is
> > "buildable"/"analyzable" for all configuration since e.g. some headers
> > are only available on certain platforms. That is, getting all include
> > paths wouldn't help you here for the general case. It seems better to
> > analyze only the files that are part of the current build
> > configuration.
> >
> > [For qmake projects:]
> > Unfortunately I don't see a way how to find out whether a file is part
> > of the current build configuration or not. We get the files via e.g.
> >
> >     "pro->variableValue(CppSourceVar)"
> >
> > in QmakeProject::updateCppCodeModel() and this seem to contain *all*
> > files of the project, independent of the configuration.
> >
> > @Daniel: Is there a way to get only the files that are selected by the
> > build configuration?
> Yes we have that information, we just don't store it anywhere since so far
> no
> one had any use for it.
>
> daniel
>



-- 
Mit freundlichen Grüßen
Roman Nikiforov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20150203/83a92e80/attachment.html>


More information about the Qt-creator mailing list