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

Eike Ziller eike.ziller at nokia.com
Wed May 27 12:59:04 CEST 2009


On May 27, 2009, at 12:26 PM, ext christian at hoenig.cc wrote:

> Hi,
>
>> 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 ;-).
>
> This is very useful for example when you are refactoring and loads  
> of your
> files don't compile. A simple make won't do in that case. But you  
> can compile
> the one file you are currently fixing (and the included ones, 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.

The "path/to/" part is the fun part ;)

mysub/some/path/myincl.pri:
SOURCES += $$PWD/myfile.cpp

mysub/mysub.pro:
include(some/path/myincl.pri)
OBJECTS_DIR=$${OUT_PWD}/.obj

myapp.pro
TEMPLATE=subdirs
SUBDIRS=mysub

> So if anybody want's to implement this feature, he would make me  
> happy, too
> ;-)
>
> take care, have fun
> /christian
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator

-- 
Eike Ziller
Software Engineer
Nokia, Qt Software
Phone  +49 (0)30 6392 3255
Fax    +49 (0)30 6392 3256
E-mail eike.ziller at nokia.com







More information about the Qt-creator-old mailing list