[Qt-creator] CppTools::ProjectInfo project sources and include paths
roman at nikiforoff.de
Mon Apr 20 14:59:44 CEST 2015
finally I found time to finish the first preliminary version of plugin. It
has some limitations described in readme, but works for me. I put source
code to github under
On Tue, Feb 3, 2015 at 5:11 PM, Roman Nikiforov <roman at nikiforoff.de> wrote:
> 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
>> > > configuration. Consequently Lint cannot resolve some includes and
>> > > 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.
> Mit freundlichen Grüßen
> Roman Nikiforov
Mit freundlichen Grüßen
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qt-creator