Qt 5.2, iOS and CMake
-
Hi
can anyone explain, or provide a sample project, how to setup Qt 5.2 using CMake to generate Xcode projects.
I can do most of the project setup without CMake but handling the moc-ing is a pain so would like to use CMake to setup it all up for me.Cheers,
Mike
-
There is a manual page for it:
http://qt-project.org/doc/qt-5.1/qtdoc/cmake-manual.html -
I decided not to use CMake to generate things in xcode. I created a build rule for .h files.
- Create a new build rule
- Change the file extension to *.h
- ${QTDIR}/bin/moc ${INPUT_FILE_PATH} -o ${DERIVED_FILES_DIR}/moc_${INPUT_FILE_BASE}.cpp
4)in the output files add
$(DERIVED_FILES_DIR)/moc_$(INPUT_FILE_BASE).cpp
Now all you have to do is add the .h files to the compile sources under the build phases tab.
-
Was advised to look at https://code.google.com/p/ios-cmake/
Haven't done so yet...Xcode rules seem easy enough, found more detailed description here:
http://gauthieralexandreblog.wordpress.com/2012/12/14/qt-and-xcode-4-5-how-to-moc-q_object-classes-automatically/