Kdevelop4: how to

Fred Labrosse ffl at aber.ac.uk
Wed Nov 4 10:18:58 GMT 2009


On Tuesday 03 November 2009 18:30:35 Andreas Pakulat wrote:
> On 03.11.09 17:37:21, Fred Labrosse wrote:
> > On Tuesday 03 November 2009 17:03:59 Andreas Pakulat wrote:
> > > On 03.11.09 16:01:08, Fred Labrosse wrote:
> > > > Here are my problems.  I tried to import an existing project so
> > > > clicked on Project-> Open/Import project and navigated to the
> > > > directory where a top Makefile.am was and opened that.  That created
> > > > a "Projects" tab on the side that in fact looks like it contains
> > > > targets specified in the Makefile created from the Makefile.am 
(apart
> > > > from the fact that this is called "Projects" rather than "Targets"
> > > > and that this contains far too many targets, this is fine).
> > >
> > > Well, its called "Projects" because it'll contain all open projects. 
It
> > > also contains not jus the targets but also the filesystem hierarchy of
> >
> > your
> >
> > > project.
> >
> > I see.  I had noticed files and such.  A bit miss-leading IMHO.
> 
> No, its a tree of your project, that includes all the files of your
> projects but of course also the targets. In particular the targets are
> used to be able to easily add files to them (well for cmake projects,
> not for custom makefiles or automake) and also to be able to easily
> execute a target or build just that target.

I understand.

> 
> > > > Then I looked at the "Classes" tab which contains classes from my
> > > > whole directory hierarchy where all my projects are, not just the
> > > > project I opened.
> > >
> > > So you have:
> > >
> > > somedir/
> > >
> > >  - projecta
> > >
> > >  - projectb
> > >  ...
> > >
> > > And you get classes from both projecta + projectb after selecting
> > > "projecta" as directory to import from? Which Manager did you choose
> >
> > during
> >
> > > import? this is certainly not the intended behaviour, nor is it what I
> > > see here (using cmake).
> >
> > This is exactly that.  Both Custom and Generic Makefile.
> 
> Can't reproduce this with either, can you share your project?

A bit big for that.  However, I can give you more details.  The two 
directories are called imalib and imalib.cvs and both contain very similar 
files and classes (the cvs one is an old version).  In particular, some 
classes, say distancePanoramic, have moved from one file in imalib.cvs, say 
distance.h, to another in imalib, say distancePanoramic.h.  In the Classes 
tab after opening the project in imalib, when I click on the class 
distancePanoramic, it opens the file distance.h from the directory 
imalib.cvs rather than the file distancePanoramic from the directory imalib.  
Just to recapitulate, here's my hierarchy:

src/
   imalib.cvs/
      src/
         distance.h (contains class distancePanoramic and others)
   imalib/
      src/
         distance.h (does _not_ contain class distancePanoramic anymore)
         distancePanoramic.h (does contain class distancePanoramic and 
others)

After opening imalib.kdev4 in imalib, clicking on class distancePanoramic 
opens file imalib.cvs/src/distance.h instead of 
imalib/src/distancePanoramic.h.

If you can't reproduce that I could try to create a fake case (as a subset 
of my project).

> 
> > > > I noticed that in the settings one can specify a base directory for 
a
> > > > project, which does not solve the problem.  On top of that, this
> > > > appears to be a kdevelop-wide setting, not just for the project I
> > > > opened.  Also, this didn't seem to have much effect at all.
> > >
> > > That directory is just the base dir used for creating new projects and
> >
> > used
> >
> > > as starting point for the open/import project dialog. All
> > > project-related settings can be found under Project->Project
> > > Configuration after selecting a project.
> >
> > Selecting a project which is not the same as opening one.
> 
> Right, because there are potentially multiple projects. However we do
> plan to set the initial selection upon opening the first project...
> 
> > You mean selecting one in the Projects tab.  I think this is what gets
> > me where I think, IMHO, the word "project" is used for different
> > things.
> 
> No, "Project" always refers to a Project in the Projects tree (i.e. a
> top level item), which has a name.kdev4 file in it (after you import
> it).

I now understand that.  What got me is that in the Project menu, you can 
always build all projects and only one thing (it only says "Build") when 
something was selected in the Project tab.  So making the link between these 
two, I assumed that what is selected in the Project tab is a project 
(because this is what is used in the Project menu).  I think that what 
should be in the Project menu should be "Build target" rather then simply 
"Build".

Minor point really.

Apart from these "problems" (or rather miss-understandings from my part) I 
like it!

Fred





More information about the KDevelop mailing list