The new Qt 5.1 has (partial) support for iOS as mentioned in the release announcement, but how do I actually build and deploy a Qt project to a iOS device? Or in other words, how do I end up with a iOS XCode project?
This shows how to compile qt5 for the iOS simulator.
Based on qt build instructions for iOS.
If you want to build for an iOS device, you have to check out the qt5 sources a second time to a second directory and use the alternate configure command as shown below.
This uses qt 5.2 beta 1. Check for newer versions with git tag
.
git clone git://gitorious.org/qt/qt5.git qt5-ios-simulator.git
cd qt5-ios-simulator.git
git tag
git reset --hard v5.2.0-beta1
Initialize qt but do not use webkit because it takes too long to compile
perl init-repository --no-webkit
Configure qt to use open source version with simulator, skipping examples and test
./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests -sdk iphonesimulator
Alternatively, use this configure command in a separate git checkout to build for iOS devices
./configure -xplatform macx-ios-clang -developer-build -opensource -release -nomake examples -nomake tests
Run make. Uses 4 jobs in parallel for faster compilation.
make -j 4
cd ..
Done.
You may test if everything works by building an example project
git clone https://github.com/msorvig/qt-ios-demo.git
cd qt-ios-demo
../qt5-ios-simulator.git/qtbase/bin/qmake
open qt-ios-demo.xcodeproj
I have not tried it myself yet but I would guess have to install XCode and Qt Creator on your OSX. As I know the Qt guys its probably like the Android version. Just try to install the Qt SDK with the online installer and select the iOS version. The rest should be possible in QtCreator. I would be interested to know if it worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With