PDA

View Full Version : Qt + XCode = No rule to make target



mentalmushroom
29th January 2013, 14:35
Hello. I'm trying to build a simple Qt application with XCode IDE. My qmake project file looks like this:


TEMPLATE = app
CONFIG += console
SOURCES = main.cpp
MOC_DIR = $${PWD}/moc
include(/usr/local/qt-solutions/qtsingleapplication/src/qtsinglecoreapplication.pri)


In order to create xcode project I run qmake -spec macx-xcode myapp.pro

When I try to build the created xcode project I get the following error:


make: *** No rule to make target `/path/to/myapp/moc/moc_qtsinglecoreapplication.cpp', needed by `compilers'. Stop.
Command /bin/sh failed with exit code 2


If I don't set the MOC_DIR in the project file it is compiled without any issues, but then I have all those moc_xxx.cpp and *.moc files among my source files that makes some kind of disorder. I'd like to keep all the generated files in a separate folder. Is it possible to keep them in a MOC_DIR and still be able to build xcode project?