PDA

View Full Version : MOC, RCC & UIC on CodeBlocks



chameleon
7th May 2010, 01:28
I am using for many years CodeBlocks as my C++ projects environment.
I started a Qt project, 3 months ago, but I don't want to use QtCreator or qmake. I want to keep using CodeBlocks.

So, If someone here is using CodeBlocks, please lets give a try on these questions:

Is there a way to run automatic, moc, rcc and uic and add automatic to project generated files? with CodeBlocks of course.

If not:
I use as my Qt project prebuild step these commands (Lots of lines stripped):

moc.exe -o ./src/qt/moc_GLMainWidget.cpp ./src/GLMainWidget.h
rcc -name resource ./src/resource.qrc -o ./src/qt/qrc_resource.cpp
uic.exe -o ./src/qt/ui_QtMainWindow.h ./src/QtMainWindow.ui
Why, when source file has older timestamp from target, compilation takes place?
There are many Q_OBJECT, RCC and UI files and need a big amount of time.
A workaround?

PS: Thanks a lot. I know, my English sucks.

wysota
7th May 2010, 07:49
Why, when source file has older timestamp from target, compilation takes place?
Why wouldn't it? It is make that decides whether the target is older than the source and does that only if you explicitely mark dependencies of some make rule. Other tools don't do such checks.


There are many Q_OBJECT, RCC and UI files and need a big amount of time.
A workaround?
QMake :) This is the only tool that checks for existance of Q_OBJECT macros in header files and runs moc only for those files that need mocing. Without it you either have to run moc manually or run it on every header file.