PDA

View Full Version : qmake, uic and moc output folders



gri
30th March 2007, 11:40
Hello again, here is my next question :)

My program is split into multiple directories, the structure looks like this:
project.pro
main.cpp
settings/settings.pri
settings/settingsdialog.cpp
settings/settingsdialog.ui
settings/pages/pages.pri
settings/pages/generalpage.cpp
settings/pages/generalpage.ui

Now if I build the Makefile generated by qmake the "moc_*.cpp"'s and the "ui_*.h"'s are put into the main folders which requires scary includes like "../../ui_generalpage.h" in the subfolders.

Is there a way to get "uic" and "moc" put the output files in the directories where their input source is?

If there's a way doing that with subprojects instead of project includes without creating a static/dynamic lib for the subfolders please tell me :)

Thanks

jacek
30th March 2007, 12:37
Is there a way to get "uic" and "moc" put the output files in the directories where their input source is?
Try changing MOC_DIR, UI_DIR, RCC_DIR and OBJECTS_DIR variables.


If there's a way doing that with subprojects instead of project includes without creating a static/dynamic lib for the subfolders please tell me
Instead of a .pro file with subdirs template, you can create one with app template that includes .pri files from subdirectories.

But you can also consider switching to CMake.

jpn
30th March 2007, 19:55
INCLUDEPATH (http://doc.trolltech.com/4.2/qmake-variable-reference.html#includepath) might also come in handy.