Cmake project loading

Andreas Pakulat apaku at
Thu Jun 10 06:54:15 UTC 2010

On 10.06.10 00:32:51, Nicolás Alvarez wrote:
> On 6/9/10, Benjamin Schindler <bschindler at> wrote:
> > Hi
> >
> > I just recently completely redesigned the (cmake-)build system for my
> > project and it seems I've done something which kdevelop really does not
> > like at all.
> >
> > The sample project I attached takes a very long time to load given that
> > there are <100 source files listed. It seems to me that kdevelop gets
> > hit by some infinite loop when autogenerating the source files from the
> > xsd files (the files are generated using the codesynthesis xsd compiler)
> >
> > Could somebody have a look at this issue?
> The problem seems to be caused by lack of proper variable scope in
> functions, which I reported last month:

I've raised priority of the bugreport now

> Many functions in your code are appending elements to variables, and
> (correctly) expecting the variable to start empty at the beginning of
> the function. In CMake, if you set a variable inside a function (and
> don't use parent_scope), it goes away when the function ends. However,
> in KDevelop, functions and macros work the same, and variables keep
> their value when the function ends and it's later called again. In
> other words, there is no such thing as a "local variable".
> I think it'd take quite some work to add proper variable scopes.
> As a workaround, clear those variables at the beginning of the
> function. I searched for all SET calls that added stuff to a variable
> with set(foo ${foo} somethingelse), were inside a function, and didn't
> use PARENT_SCOPE, and I set them to "" at the beginning of the
> function. The project now takes 3 seconds to load. Patch attached.

I don't think this will be a big problem, we could just use a
QStack<QStringList> as "variable" in the map where a function adds to
the stack (unless parent_scope is set) and end of function drops from
the stack...


Courage is your greatest present need.

More information about the KDevelop-devel mailing list