PDA

View Full Version : Set Debug or Relase build options in Xcode instead of .pro file?



will49
8th November 2007, 20:52
I have a project that I compile on the Mac in XCode. I make the XCode project from the .pro file using "qmake -spec macx-xcode .....pro".

XCode has Project -> Build Configurations for Release and Debug in the Project menu.

I was wondering if it is possible to get the XCode project to be configured for *both* the debug and build version from the .pro file SIMULTANEOUSLY?

i.e. Instead of having to specify CONFIG += release or CONFIG += debug in my .pro file and then having to rebuild the XCode project each time from the .pro file, it would make both debug and release project configurations for XCode. Then I only need to select which one I want from the XCode Projects -> Build Configurations menu.

In my .pro file I have sections like the following which define the build options, based on the
CONFIG += release or
CONFIG += debug defined earlier in the .pro file.


CONFIG(debug, debug|release) {
# here comes debug specific statements
} else {
# here comes release specific statements
DEFINES += QT_NO_DEBUG_OUTPUT
}

Is that possible to do? I don't want to edit the XCode project files to have specific options for debug/release because they get destroyed each time I regenerate the project from the .pro file.

marcel
8th November 2007, 21:04
try CONFIG += debug_and_release

will49
8th November 2007, 21:15
Do you mean use this:

CONFIG += debug_and_release

CONFIG(debug, debug|release) {
# here comes debug specific statements
} else {
# here comes release specific statements
DEFINES += QT_NO_DEBUG_OUTPUT
}


I tried that but the release build of my app (when built with the release version selected in XCode) still outputs qDebug() stuff so it looks like its not making both configurations.