# Projucer, Xcode Macros and Escaping

**URL:** <https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685>\
**Category:** Audio Plugins\
**Created:** [January 22, 2017, 4:30pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685 "2017-01-22T16:30:51Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [January 22, 2017, 4:30pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/1 "2017-01-22T16:30:51Z")

</div>

So I’ve started implementing AAX PageTables on our plug-ins.  
In order to use it you must have a define and make sure you add the file to your Resources\*.  
(might be worth handling this nicer for Win/Mac & AAX but that’s another story…)

When I define:  
JucePlugin\_AAXPageTableFile=“PluginNameAAXPageTable.xml”

- Xcode, this WON’T work! the quotes being used by Xcode itself.
- VS2015, works as expected.

When I define:  
JucePlugin\_AAXPageTableFile=“PluginNameAAXPageTable.xml”

- Xcode Yells since it actually breaks the xcode-xml file…

When I define:  
JucePlugin\_AAXPageTableFile=\“PluginNameAAXPageTable.xml\”  
(I’ve edited this as discourse escaped me 🙂 )

- It works for Xcode! yay!
- It’s broken for VS ☹

Summary:  
For now I need to DoRY instead of DRY.

Might be nice to fix this…

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 23, 2017, 9:38am UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/2 "2017-01-23T09:38:42Z")

</div>

We’ll have a look at this.

Do you want the definition of JucePlugin\_AAXPageTableFile to include the surrounding “”?

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [January 23, 2017, 9:55am UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/3 "2017-01-23T09:55:04Z")

</div>

@t0m I didn’t find any documentation of JucePlugin\_AAXPageTableFile

However looking at the code and testing shows the following:

1. The actual use of JucePlugin\_AAXPageTableFile is to a const char\* which is the filename to be used for mapping…  
So… just as JUCE plug-in name #define is quoted this also must be quoted.
2. You also need to add it to .aaxplugin/Contents/Resources  
(btw, with current JUCE separate plug-in builds this isn’t trivial. You add Resources in Projucer, but which show up on ALL targets. might be nice adding AAXPageTable to the projucer settings as a filename/path value)

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [January 23, 2017, 12:44pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/4 "2017-01-23T12:44:28Z")

</div>

I’ve pushed a fix for this to develop. The following should now work on OS X too:

```
JucePlugin_AAXPageTableFile="PluginNameAAXPageTable.xml"
```

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [January 25, 2017, 9:48am UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/5 "2017-01-25T09:48:37Z")

</div>

Hi @t0m,  
Well… close enough 😉 Xcode needs escaping so the export for Xcode should be:  
`JucePlugin_AAXPageTableFile="\PluginNameAAXPageTable.xml\"`

☹…  
In order to avoid multiple defines for each platform…

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [June 26, 2018, 4:26pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/6 "2018-06-26T16:26:44Z")

</div>

Does this escaping still work? I was trying to add a page table for a plugin and I ended up having to have a definition like:

`JucePlugin_AAXPageTableFile="\"PluginNameAAXPageTable.xml\""`

…to get it to compile (but doesn’t work for runtime). My solution right now is to write the definition into the user section of `AppConfig.h`:

`#define JucePlugin_AAXPageTableFile "PluginNameAAXPageTable.xml"`

---

<div class="post-metadata">

**Author:** ![HowardAntares](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/howardantares/32/4629_2.png) [@HowardAntares](https://forum.juce.com/u/HowardAntares)\
**Post date:** [January 2, 2019, 10:57pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/7 "2019-01-02T22:57:23Z")

</div>

The problem with writing to the AppConfig.h file is that that is not under source control for us, since it’s in the JuceLibraryCode folder that gets generated, and we don’t want all that stuff in source control when it can all be generated. Perhaps we need to add _just_ that file?

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)\
**Post date:** [January 2, 2019, 11:03pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/8 "2019-01-02T23:03:29Z")

</div>

Yes, we used to exclude specifically `AppConfig.h` file from the gitignore, just for the UserSection

```auto
**/.DS_Store
Builds
JuceLibraryCode
!JuceLibraryCode/AppData.h

```

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [January 3, 2019, 9:33am UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/9 "2019-01-03T09:33:43Z")

</div>

> [@TonyAtHarrison](#):
>
> …to get it to compile (but doesn’t work for runtime). My solution right now is to write the definition into the user section of `AppConfig.h` :

That’s IMHO not the elegant solution. as @HowardAntares mentioned,  
it’s a generated file… if it’s not resolved by current JUCE builds then it should be addressed. I’ll see on Sunday what’s going on, our releases still uses JUCE 4.3.x IIRC, but I’ll see if 5.x got this regressed as it seems to be working for us.

---

<div class="post-metadata">

**Author:** ![goodhertz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/goodhertz/32/74_2.png) [@goodhertz](https://forum.juce.com/u/goodhertz)\
**Post date:** [November 1, 2021, 6:01pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/10 "2021-11-01T18:01:56Z")

</div>

This still seems to be broken as of JUCE 6.1.2. Is the best solution still modifying AppConfig.h?

---

<div class="post-metadata">

**Author:** ![yairadix](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yairadix/32/1114_2.png) [@yairadix](https://forum.juce.com/u/yairadix)\
**Post date:** [November 2, 2021, 1:10pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/11 "2021-11-02T13:10:05Z")

</div>

It works on SR’s branch, if that helps…

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 2, 2021, 7:40pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/12 "2021-11-02T19:40:01Z")

</div>

Please can you describe exactly what is not working for you?

I just tried adding `JucePlugin_AAXPageTableFile="PluginNameAAXPageTable.xml"` to the global Preprocessor Definitions field of a Projucer plugin project, and then building it on both Xcode and VS2019. In both cases, `static_assert (false, JucePlugin_AAXPageTableFile)` in the source code prints `PluginNameAAXPageTable.xml` as I would expect.

---

<div class="post-metadata">

**Author:** ![goodhertz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/goodhertz/32/74_2.png) [@goodhertz](https://forum.juce.com/u/goodhertz)\
**Post date:** [November 3, 2021, 6:01pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/13 "2021-11-03T18:01:39Z")

</div>

Looks like this works if the filename has no spaces, but Xcode fails with `The project is damaged and cannot be opened due to a parse error` otherwise.

That’s an easy enough fix for us, though it’d be great to have the option of a preprocessor macro string with spaces.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 3, 2021, 6:37pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/14 "2021-11-03T18:37:41Z")

</div>

Thanks, I’ll investigate.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [November 3, 2021, 7:32pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/15 "2021-11-03T19:32:20Z")

</div>

It looks to me like this is working as intended. The help text for the Preprocessor Definitions field says

> to include a space or a comma in a definition, precede it with a backslash

Accordingly, specifying `JucePlugin_AAXPageTableFile="Plugin\ Name\ AAXPageTable.xml"` in the Projucer results in the definition of a quoted string that includes spaces.

---

<div class="post-metadata">

**Author:** ![goodhertz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/goodhertz/32/74_2.png) [@goodhertz](https://forum.juce.com/u/goodhertz)\
**Post date:** [November 3, 2021, 8:25pm UTC](https://forum.juce.com/t/projucer-xcode-macros-and-escaping/20685/16 "2021-11-03T20:25:10Z")

</div>

Ah, I see. Sorry! That’s our mistake.
