[Qt-creator] Compile a single .cpp file?

Frank Siegert frank.siegert at durham.ac.uk
Wed May 27 14:23:03 CEST 2009


christian at hoenig.cc, Wednesday 27 May 2009:
> > Actually, your build system should care about this and only compile
> > the files which have been changed.
> > Obviously linking needs to be done at the end.
>
> Yes, you're right, but I think the idea is not to compile anything else
> then the currentcly opened .cpp. /Me is missing this feature, too ;-).

/Me too. ;-)

> A workarund is the following:
> As qmake generates Makefiletargets for all .o files, you can call
> 	make -f Makefile.Debug path/to/currentfile.o
> to build this file only.

This would be possible (and more general, i.e. also for Makefile-based
projects), if one could use some variables in the build settings
(command and working directory), like currently open document name and
directory.
I have suggested this in the context of running "make" in the current
directory, which for me would be the same use case as compiling a single
.cpp file:

http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=252810

Frank




More information about the Qt-creator-old mailing list