To shed some more light, QtCreator has extra logic on top of QMake to let it create different shadowbuilds (and different XCode projects with different build settings) for device and simulator. The config variables "iphoneos" and "iphonesimulator" is set by QtCreator.
But QMake alone does not distinguish between device and simulator. Any XCode project that you create with QMake (from QtCreator or from the terminal) will always support both simulator and device. This is how XCode works. You switch between device and simulator from the scheme menu inside XCode. -Richard ________________________________ Fra: [email protected] [[email protected]] på vegne av Shobana Suresh [[email protected]] Sendt: 17. februar 2014 04:33 To: Mohamed Fawzi Cc: [email protected] Emne: Re: [Development] Qmake variable for iOS Hi Fawzi, Thanks for the explanation. You are right. Though the message is misleading, it appears to work. I tried the below simple test and it worked as expected. App1.pro: ios { iphonesimulator { message("iphonesimulator") DEFINES += iphonesimulator } iphoneos{ message("iphoneos") DEFINES += iphoneos } } Mainwindow.cpp void MainWindow::on_pushButton_clicked() { QMessageBox msgBox; #ifdef iphonesimulator msgBox.setText("Simulator"); #elif defined (iphoneos) msgBox.setText("Phone"); #endif msgBox.exec(); } Thanks Shobana From: Mohamed Fawzi <[email protected]<mailto:[email protected]>> Date: Sat, 15 Feb 2014 01:36:31 +1100 To: Shobana Suresh <[email protected]<mailto:[email protected]>> Cc: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: Re: [Development] Qmake variable for iOS Hi, qmake for ios is a bit strange, in the sense that it treats device and simulator as two build versions. This is like debug and release, setting it in CONFIG sets the default used in Makefile, but it also still generates specific makefiles for each possible combination (iphoneos debug/relase,...). This is a bit unecessary, especially for how it is used in creator (shadow build, always setting the default, and always building using the default Makefile. So message is misleading because it is called for each Makefile version. Thill it should work, have you tried to see? Fawzi On 10 Feb 2014, at 01:30, Shobana Suresh <[email protected]<mailto:[email protected]>> wrote: Hello All, I am trying to find the qmake variable that could be used to differentiate between the iPhone simulator and iPhone arm kits. In my .pro file, I would like to use conditions like 1. ios { 2. CONFIG += c++11 3. iphonesimulator { 4. message("iphonesimulator") 5. #Do Something 6. } 7. iphoneos{ 8. message("iphoneos") 9. #Do Something 10. } 11. } On running qmake with the iphonesimulator kit, it prints out 1. Project MESSAGE: iphonesimulator 2. Project MESSAGE: iphonesimulator 3. Project MESSAGE: iphonesimulator 4. Project MESSAGE: iphonesimulator 5. Project MESSAGE: iphoneos 6. Project MESSAGE: iphonesimulator 7. Project MESSAGE: iphonesimulator 8. Project MESSAGE: iphoneos With iPhone device kit , it prints 1. Project MESSAGE: iphoneos 2. Project MESSAGE: iphoneos 3. Project MESSAGE: iphoneos 4. Project MESSAGE: iphonesimulator 5. Project MESSAGE: iphoneos 6. Project MESSAGE: iphoneos 7. Project MESSAGE: iphonesimulator 8. Project MESSAGE: iphoneos I tried using the QT_ARCH variable, but message($$QT_ARCH) prints out “arm” for both the kits. What is the correct qmake variable to use to differentiate between iPhone simulator and iPhone arm kits? Regards Shobana _______________________________________________ Development mailing list [email protected]<mailto:[email protected]> http://lists.qt-project.org/mailman/listinfo/development __________ Information from ESET NOD32 Antivirus, version of virus signature database 9109 (20131128) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
