# Cmake: Names with spaces

**URL:** <https://forum.juce.com/t/cmake-names-with-spaces/54689>\
**Category:** CMake\
**Created:** [January 25, 2023, 11:14am UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689 "2023-01-25T11:14:07Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [January 25, 2023, 11:14am UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/1 "2023-01-25T11:14:07Z")

</div>

If I set Project(“FancyPants X6”) with a space in it I get an error:

CMake Error at swag/juce/extras/Build/CMake/JUCEUtils.cmake:1764 (add\_library):  
The target name “FancyPants X6” is reserved or not valid for certain CMake  
features, such as generator expressions, and may result in undefined  
behavior.

Is it impossible to make a project with a space in the name, and if so how do we set it up so our plugins binaries have a space in the name?

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [January 25, 2023, 11:16am UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/2 "2023-01-25T11:16:47Z")

</div>

Ah - maybe it’ s the PRODUCT\_NAME juce thingi I think.

---

<div class="post-metadata">

**Author:** ![AdamVenn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamvenn/32/17023_2.png) [@AdamVenn](https://forum.juce.com/u/AdamVenn)\
**Post date:** [January 25, 2023, 11:59am UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/3 "2023-01-25T11:59:12Z")

</div>

I’ve been meaning to check if a product name with spaces causes problems for Mac’s bundle ID. You might want to get there before me!

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [January 25, 2023, 12:18pm UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/4 "2023-01-25T12:18:43Z")

</div>

I’m having all kinds of weird issues. Ihe CFBundleIdentifier in the Info.plist is missing the product name entirely. My Projucer based plugin looks like :sli

```auto
<key>CFBundleIdentifier</key>
<string>com.deviousmachines.infiltrator</string>

```

But my cmake based on is:

```auto
    <key>CFBundleIdentifier</key>
    <string>com.deviousmachines.pkg</string>

```

Though apparently this is nothing to do with spaces as it’s happening to all my cmake projects at the mo!

---

<div class="post-metadata">

**Author:** ![asimilon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/asimilon/32/4235_2.png) [@asimilon](https://forum.juce.com/u/asimilon)\
**Post date:** [January 25, 2023, 12:41pm UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/5 "2023-01-25T12:41:48Z")

</div>

Very curious to know how this can be resolved, came acropper with the same issue and couldn’t figure it out so just went with CamelCasePluginName, which kind of sucks.

---

<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:** [January 25, 2023, 12:51pm UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/6 "2023-01-25T12:51:36Z")

</div>

The way this is supposed to work is that the output name is taken from `PRODUCT_NAME`. I’m pretty sure this bit works as expected - the AudioPluginExample generates bundles named `Audio Plugin Example.ext`.

In the CMake API docs, the bundle ID is supposed to be derived from the company name and PRODUCT\_NAME, although it looks like in reality it’s derived from the company name and CMake target name. I’ll update the docs (changing behaviour seems a bit dangerous in this case!). If you’re not happy with the generated ID, you can specify a completely custom one, using the `BUNDLE_ID` option. It’s probably a good idea to avoid spaces in the ID, so if your product/company name contains spaces, I’d recommend setting a BUNDLE\_ID with no 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:** [January 26, 2023, 11:27am UTC](https://forum.juce.com/t/cmake-names-with-spaces/54689/7 "2023-01-26T11:27:24Z")

</div>

CMake builds will now warn if the bundle ID contains spaces:

> <https://github.com/juce-framework/JUCE/commit/10baaa420be1cb525cd04da0ccbad80b3b8b9ea1>
