PDA

View Full Version : qmake failure for SUBDIRS template on OSX



lonejedi
8th December 2006, 20:31
Though not new to QT in general, I am still learning the ropes for Qt/Mac so I'll start looking for help here in the Newbie forum ;)

I have a sizable project that uses a top-level .pro file using the SUBDIRS template to build the main execuatble as well as many plug-in libraries from sub-directories (each with their own .pro files). When I run qmake on that main .pro under Qt/Win it properly parses down to each directory making all of the necessary make files, and then nmake from that top-levels builds the entire solution. When I take the same source and attempt to qmake it on OSX I get a cascade of file-not-found failures as it tries to find each sub-project's .xcodeproj file (which is what it should be building). If I manually go to each subdirectory and qmake each and every .pro file and then go back to the top-level (the one with the SUBDIRS template) and qmake again then it claims it's happy... but loading the .xcodeproj that it builds still doesn't provide a "one-stop shop" for building the entire project at once (by loading each individual .xcodeproj file and building one at a time I do get a working solution, though).

Can someone slap their foreheads and tell me the simple thing that I'm missing? :D

I don't have my .pro files handy for posting right now, but if no one recognizes my symptoms as something common then I can post them in a follow-up.

Thanks for any and all assistance,
-Jason

e8johan
19th January 2007, 13:49
Could this be the same problem as this: http://lists.trolltech.com/qt-interest/2006-07/thread00535-0.html .

I.e. if you do not use qmake to generate makefiles it is bound to fail.

Brandybuck
20th January 2007, 03:06
Can someone slap their foreheads and tell me the simple thing that I'm missing? :D
I don't think you're missing anything. I get the same problem when using the macx-xcode makespec. If you can tolerate the hassle of typing "make" in the command line, try using the macx-g++ makespec.

blarf
24th May 2010, 00:02
Reviving an old thread, I know. It's probably worth noting that qmake (as of 4.6.2) appears to only support the SUBDIRS target where GNU Makefiles will be used.

So on OSX with Qt Creator will work fine with subdirs. If you then run make from the command line, everything works. If you run qmake from the command line to have it generate XCode files, it won't handle the subdirs at all.

If you try this from FreeBSD, it will generate makefiles just fine. However, those make files can only be understood with 'gmake', and not the standard BSD make.

If you try this from Windows, you'll get makefiles that nmake cannot parse.