# Cannot Update AUv3 Bundle Identifier with CMake

**URL:** <https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313>\
**Category:** General JUCE discussion\
**Created:** [August 4, 2023, 9:41pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313 "2023-08-04T21:41:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 4, 2023, 9:41pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/1 "2023-08-04T21:41:28Z")

</div>

Hi JUCE Community,

I’ve come across an interesting challenge while updating some iOS AUv3 plugins to use CMake as the underlying build configuration system.

It appears that updates to the `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` variable have no impact on the generated `CFBundleIdentifier` field within the AUv3 Info.plist file. My project has a bundle suffix that differs from the specified `BUNDLE_ID`, however, I cannot seem to make updates to this field.

For example, if `BUNDLE_ID` is `com.yourcompany.foo`, my AUv3 bundle ID becomes `com.yourcompany.foo.fooAUv3` by default. If I update the `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` cmake variable to be `com.yourcompany.bar.barAUv3` for my AUv3 target, the field will update within my Xcode project, but it’s never applied to the generated Info.plist file.

When I generate my AUv3 target and examine the info.plist file, the `CFBundleIdentifier` field is _still_ `com.yourcompany.foo.fooAUv3`. Why’s this?

Has anybody encountered this, and found solutions to rememdy this issue? Any assistance would be wonderful. Surely I shouldn’t need to run `plutil` as a post-build step to fix this…

Thanks,  
Bruce

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 7, 2023, 2:57pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/2 "2023-08-07T14:57:18Z")

</div>

Bump. Looking for some solutions or insights here.

One would think that setting `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` at the CMake level would translate to an updated `CFBundleIdentifier` Info.plist field per target, but it doesn’t. Why is this?

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 7, 2023, 4:35pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/3 "2023-08-07T16:35:46Z")

</div>

We’re using something like this:

```auto
    set(customPlist
            "<plist><dict>
            <key>CFBundleIdentifier</key>
            <string>com.my.custom.bundle</string>
            </dict></plist>")

    juce_add_plugin(MyPlugin
            # ...
            PLIST_TO_MERGE ${customPlist})

```

In addition to `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER`

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 7, 2023, 4:47pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/4 "2023-08-07T16:47:36Z")

</div>

Thanks so much for the contribution @eyalamir, I’ve found the `PLIST_TO_MERGE` attribute useful for merging plist information, but unfortunately the flag merges plist info for _all_ formats, whereas only my AUv3 target needs an updated bundle suffix, which I cannot seem to provide without overriding the plist entry for _all_ formats.

CMake/JUCE seems to infer the bundle suffix from the `BUNDLE_ID` identifier. For example, AUv3 bundle ID of the example above would result in `com.yourcompany.foo.fooAUv3` by default, and there appears to be no way to update the bundle suffix explicitly.

What JUCE provides: `com.yourcompany.foo.fooAUv3`  
What I’m looking to accomplish: `com.yourcompany.foo.barAUv3`

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 7, 2023, 6:21pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/5 "2023-08-07T18:21:20Z")

</div>

> [@bdawson](#):
>
> AUv3 target needs an updated bundle suffix, which I cannot seem to provide without overriding the plist entry for _all_ formats.

My solution for that is to create a separate target completely for the AUv3, and pass all the shared settings via variables/functions.

AUv3, at least for us, is a separate deployment process anyway.

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 7, 2023, 7:23pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/6 "2023-08-07T19:23:39Z")

</div>

> [@eyalamir](#):
>
> My solution for that is to create a separate target completely for the AUv3, and pass all the shared settings via variables/functions.

Thanks again Eyal, I have considered this approach as one of my last resort options, but I’d really like to avoid compiling two identical static libraries for my projects (one that AUv3 links against, and then the a library for the other plugin formats). I haven’t tried this path yet, but I assume that’s likely what would happen which I’d like to avoid if possible…

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 7, 2023, 7:52pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/7 "2023-08-07T19:52:34Z")

</div>

Yes, that’s the downside. I’m not sure if there are other solutions, but maybe @reuk can help?

---

<div class="post-metadata">

**Author:** ![anon48770766](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon48770766](https://forum.juce.com/u/anon48770766)\
**Post date:** [August 8, 2023, 6:33am UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/8 "2023-08-08T06:33:56Z")

</div>

Interesting thread … imho, creating a separate target path for AUV3 is beneficial anyway, because at some point you’re (possibly?) going to want to bundle the plugin in a container “delivery” app anyway, no?

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 8, 2023, 7:12am UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/9 "2023-08-08T07:12:40Z")

</div>

Yes.  
For us, the AUv3 and the standalone that surrounds it are also (slightly) different than the regular plugin anyway, due to sandboxing.  
So there are a couple of compile time checks where the code behaves differently - for example Apple don’t allow copy protection testing on the App Store and instead they want you to use the App Store mechanism to validate receipts.

So at least for us, it’s mandatory to have a separate target for both to configure the differences in build settings and in the actual code (The UI might also show different activation options, etc).

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 8, 2023, 3:31pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/10 "2023-08-08T15:31:31Z")

</div>

> [@DiscourseUser1](#):
>
> Interesting thread … imho, creating a separate target path for AUV3 is beneficial anyway, because at some point you’re (possibly?) going to want to bundle the plugin in a container “delivery” app anyway, no?

Thanks so much for the input @DiscourseUser1. I agree with the approach you guys have been discussing and If I were starting a “fresh,” project I’d be open to this path. The challenge I’m facing is converting existing iOS plugins from being `.jucer` based to being built using CMake while maintaining 100% parity with existing functionality and session compatibility.

The build system I’m working with would do some _weird things_ to the iOS xcodeproj file to update the iOS AUv3 bundle suffix using python. I’d love to avoid also doing _weird things with python_ myself when we have something as amazing as CMake. There must be a way…

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 8, 2023, 3:38pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/11 "2023-08-08T15:38:52Z")

</div>

Here’s an example of the folder structure for the project I’m working with. In this project, the standalone application and the AUv3 extensions operate identically aside from a a few JUCE-specific settings and as a result they have different bundle identifiers

```auto
myiOSApplication/
├─ _CodeSignature/
├─ PlugIns/
│ ├─ myiOSApplication.appex (com.yourcompany.bar.barAUv3)
│ ├─ myiOSApplicationV2.appex (com.yourcompany.bar.fooAUv3) 

```

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [August 8, 2023, 4:00pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/12 "2023-08-08T16:00:40Z")

</div>

I think your requirement makes sense but I have no idea how to do it currently other than creating another CMake target for the iOS standalone/AUv3 that’s different from the target of the other format. Usually the iOS/Mac App Store builds is a separate build project anyway that has no dependency on the other plugin formats, so it’s not like you would save some build time by having the two targets, it would only look a little different in the IDE.

Perhaps someone from the JUCE team could suggest a better idea.

---

<div class="post-metadata">

**Author:** ![tlongabaugh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/tlongabaugh/32/18640_2.png) [@tlongabaugh](https://forum.juce.com/u/tlongabaugh)\
**Post date:** [August 18, 2023, 6:05pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/13 "2023-08-18T18:05:04Z")

</div>

It certainly seems like a bug that setting `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ` has no effect on the `CFBundleIdentifier` in the `plist` file. Can the JUCE team chime in on this?

---

<div class="post-metadata">

**Author:** ![bdawson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/bdawson/32/14755_2.png) [@bdawson](https://forum.juce.com/u/bdawson)\
**Post date:** [August 18, 2023, 11:30pm UTC](https://forum.juce.com/t/cannot-update-auv3-bundle-identifier-with-cmake/57313/14 "2023-08-18T23:30:33Z")

</div>

Here’s what I found:

1. `juceaid` project needed to have logic updated in `Main.cpp` related to writing the AUv3 info.plist file, specifically [these lines](https://github.com/juce-framework/JUCE/blob/d24c2729268e322f3ba1b5070eb96ab232d7f6ba/extras/Build/juceaide/Main.cpp#L301-L304)

2. _Also_ at the `CMakeLists.txt` level set the `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` variable to the bundle identifier that is needed, such that it matches changes made to the `juceaid` logic.

```auto
if( IOS )
  set_target_properties(
    "${PROJECT_NAME}_AUv3" 
    PROPERTIES 
    XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER 
    "com.yourcompany.bar.fooAUv3"
  )
endif()

```
