Hi, I’m trying to add this preprocessor definition for an Xcode project, in the Projucer’s Extra Preprocessor Definitions field:
BUILD_NUMBER=`git rev-parse --short HEAD`
This is split by Xcode into multiple definitions due to the spaces inside of it, which can be resolved in Xcode by escaping the spaces:
BUILD_NUMBER=`git\ rev-parse\ –short\ HEAD`
So going back to the Projucer and writing this in the Extra Preprocessor Definitions field, I expected it to get through to the Xcode project config without the split; however for one reason or another the escaping gets lost and the definitions are again split across multiple lines in the Xcode project. Double-escaping yields no better result.
How would you normally go about doing this for an Xcode project without using the Projucer? It seems that multi-word commands are automatically split by Xcode into multiple, separate preprocessor definitions even if you enter them into Xcode directly.
So to add a preprocessor definition with spaces to Xcode via the Projucer’s extra preprocessor definitions field you need to escape the backslash and then escape the space, so you need to use 3 backslashes. So for your command you would need to enter this in the Projucer:
The backslash is an escape character and is required to stop Xcode from splitting the define into 2 separate defines. Try the following, where MY_MACRO is defined as Hello\ World:
Yeah, my problem is actually more complex, since I’m actually redefining
JucePlugin_Name and this definition is used by Juce in many places without the JUCE_STRINGIFY bit.
Yes, this seems to work.
About the dodgy part: what I’d like to have is a single .jucer project, where each exporter has multiple targets. In each target I’d like to redefine all the data so I can make multiple plugins based on a single project.
Thanks Ed!