Cmake project loading

Benjamin Schindler bschindler at
Thu Jun 10 08:25:30 UTC 2010


On 06/10/2010 10:09 AM, Benjamin Schindler wrote:
> Hi
> On 06/10/2010 05:32 AM, 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:
>> 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.
> Ah - that is interesting. Thanks for the hint. I've applied that patch
> and the whole project now loads in ~10-20 seconds.
> The variable repetitions still happen with this patch. I'll check
> whether some functions were missed. When the project is loaded, output
> continues in the background and the huge lists with thousands of
> repetions of Camera.h/Camera.cpp - I'll look into that

Sorry for the noise, but that's not true. The old unpatched
test-kdevelop got loaded too without me noticing. The problem is really gone


> Thank you
> Benjamin

More information about the KDevelop-devel mailing list