Compiling Just One File.

Andreas Pakulat apaku at gmx.de
Wed Sep 7 16:43:12 BST 2011


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmakesinglefile.zip
Type: application/zip
Size: 1758 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20110907/ad72be9b/attachment.zip>


More information about the KDevelop mailing list