Automatically adding files/classes to targets

Alexander Neundorf neundorf at kde.org
Thu Feb 5 17:58:59 UTC 2009


On Thursday 05 February 2009, David nolden wrote:
> We need to integrate the "new file" and "new class" wizards with the
> project- management, so code-completion etc. in the new file can work right
> away within the file, and less user-interaction is needed.
>
> Currently the work-flow for creating new files and adding them to targets
> is not confortable yet.
>
> @Aleix: I though you've worked on this, but didn't find anything in the UI.
> Or was it just the required use-building that you've implemented?
>
> I think ideally we should have something like a list of few related targets
> from a project, where you can add checkboxes to automatically add the file
> to the target, directly integrated in the new-class and new-file dialogs.

How do you want to do this ?
Let's say the developer choses target "foo". The cmake file could look like 
this:


set(blubSrcs blub1.c blub2.c)

set(fooSrcs file1.cpp file2.cpp)

if(SOME_OPTION)
   set(fooSrcs ${fooSrcs} use_feature1.cpp)
else(SOME_OPTION)
   set(fooSrcs ${fooSrcs} use_feature2.cpp)
endif(SOME_OPTION)

list(APPEND fooSrcs util.cpp)

add_executable(foo ${fooSrcs} ${libSrcs} main.cpp)

add_executable(blub STATIC ${blubSrcs} main.c)


The developer has to decide where to add the new file, I don't see a way how 
an algorithm could do this automatically.

Alex




More information about the KDevelop-devel mailing list