Compiling Just One File.

Andreas Pakulat apaku at gmx.de
Wed Sep 7 21:13:35 BST 2011


On 07.09.11 13:57:26, Michael Hart wrote:
> Either I am not making myself clear or I am not understanding how your
> answers. But I am functional
> To me what I want is just something nice to do. I using kdevelop 4.2.3 so I
> will wait for the official release of 4.3
> 
> There is not sample to send. It is as simple as taking two files and only
> wanting to compile one without building the entire project

Right and thats doable with CMake and KDevelop, including 4.2 as far as
I can see from the source. The way things work in KDevelop is that it
builds whatever is currently selected in the project tree or if there's
something in the list under "Project Selection" in the Projects toolview
on the left it builds that. Hence if you add only a .cpp file from your
project tree into the project selection and then do Project->Build
Selection (or hit the build button) it'll build just that single .cpp
file by running 

make foo.o 

in the builddirectory (if the file is foo.cpp). As was already said,
there seems to be a bug in some cases but that should produce an error
message and not build anything at all.

Andreas

> On Wed, Sep 7, 2011 at 11:43 AM, Andreas Pakulat <apaku at gmx.de> wrote:
> 
> > On 07.09.11 10:36:53, Michael Hart wrote:
> > > >The CMake+Make support also allows to build individual object files,
> > simply
> > > select the .cpp in the Project tree and hit Build.
> > > Yes, I would have thought that would be the logical way to compile a
> > single
> > > file.
> > > When I do as you recommend, the whole project get built. Which is not
> > what I
> > > want.
> >
> > Are you using Project->Build Selection? and the List labelled "Project
> > Selection" has only your .cpp file? That works fine for me with the
> > attached example cmake project. If the attached project does not work
> > for you, please file a bugreport at http://bugs.kde.org. Please include
> > the output from the Build toolview at the bottom, it should contain only
> > the make foo.o (or make main.o) call.
> >
> > If the attached project works and your real one does not, please try
> > running make yourfile.o in the build directory of your project. If that
> > also rebuilds everything then your cmake files created a dependency that
> > causes this. If it works on the commandline, again file a bugreport, if
> > possible with a reference to your real project.
> >
> > Oh and I'm currently using KDevelop 4.3 (i.e. from git directly) not the
> > last release.
> >
> > Andreas
> >
> >
> > _______________________________________________
> > kdevelop mailing list
> > kdevelop at kdevelop.org
> > https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop
> >
> >

> _______________________________________________
> kdevelop mailing list
> kdevelop at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop





More information about the KDevelop mailing list