Threadsafe project model

Nicolás Alvarez nicolas.alvarez at
Sat Jul 17 20:48:49 UTC 2010

On 17/07/2010, Andreas Pakulat <apaku at> wrote:
> On 16.07.10 19:39:59, Nicolás Alvarez wrote:
>> This isn't correct for CMake parsing, though. KDevelop parses one
>> directory at a time, then processes directories added to the model by
>> the previous parse pass; while real CMake parses scripts in
>> subdirectories immediately when the dir is added, as if it was an
>> include().
> I don't see how that contradicts what I said. CMake does exactly what I
> said, it gets 1 dir-item, parses the folder and generates childs to
> return the folder-childs from the parse function.

I wasn't very clear... CMake does exactly what you said, but I think
it's not correct (ie. it shouldn't work like that).

>> I reported this to the bug tracker a while ago:
> IMHO its not a bug as long as cmake still parses the project properly
> (i.e. targets generated in a subdir are accessible after the add_subdir
> call). Our cmake support is not supposed to replicate CMake behaviour
> 100%, its supposed to generate the necessary information that KDevelop
> needs from the cmake files and to populate the language infrastructure
> so completion etc. works.

I saw a real project doing things like:
set(somevar "foo")
set(somevar "bar")

where one/CMakeLists.txt and two/CMakeLists.txt used ${somevar} when
creating targets (eg. as part of the target name!). KDevelop's parser
makes both subdirectory scripts see it set to 'bar'.


More information about the KDevelop-devel mailing list