PDA

View Full Version : Help with qmake's SUBDIRS template



danielperaza
13th May 2011, 21:02
Hi, I'm using Qt 4.7 on Mac OS X 10.6.7. I have a project, which I'd like to keep organized like this:

/- # My main project directory, where the .pro file should live in
-- build/ # Build directory where my .app should be put in
-- src/ # Sources directory, for all .h and .cpp files.
-- forms/ # Forms directory, for all .ui files.
-- generated/ # A directory for all files generated by the building process.

I've tried to search some docs in QtAssitant and Google, but I they wether aren't what I'm looking for, or I just couldn't understand it :o

Please, can somebody give me a hand on this?

Lykurg
13th May 2011, 21:10
Well, then you have to improve your search strategies! See the qmake variable reference. I give you one starting point: MOC_DIR.

danielperaza
13th May 2011, 21:51
I tried this http://stackoverflow.com/questions/1417776/how-to-use-qmakes-subdirs-template but it didnt' work.

Furthermore, it doesn't says where I should pass the QT variable flags (I'm using gui & opengl).

I'm sorry if the answer looks too obvious for you, but this is the first time I tried this, and QtAssitant doesn't assists me that much!. I think that QtCreator should do this for me, just the same way that other IDEs allow me to create a source code folder easily, but this is far from reality.

ChrisW67
15th May 2011, 10:12
I tried this http://stackoverflow.com/questions/1417776/how-to-use-qmakes-subdirs-template but it didnt' work.
There's nothing fundamentally wrong in the SO post, which gives you a number of ways to approach this. "It didn't work" is not a useful description of the problem you are experiencing. Post the actual PRO/PRI files you are using and a description of the expected and actual behaviour.

You can also look here for an example: http://www.qtcentre.org/threads/37177-Qt-project-management-bigger-project?highlight=subdirs


Furthermore, it doesn't says where I should pass the QT variable flags (I'm using gui & opengl). You put QT, CONFIG, SOURCES, HEADERS etc. in the PRO file of each sub-directory.