"Copy plugin step" fails in CLion exporter, and VST/VST3 plugins are not built as bundles

This is on OSX.

The “enable copy plugin step” fails when using the default options and when using the entire pathname. Here are my errors:

Copying "PluginName.vst3" to "Users/MyUserName/Library/Audio/Plug-Ins/VST3/"
make[2]: cmake: No such file or directory
make[2]: *** [PluginName.vst3/Contents/MacOS/PluginName] Error 1
make[2]: *** Deleting file `PluginName.vst3/Contents/MacOS/PluginName'
make[1]: *** [CMakeFiles/VST3.dir/all] Error 2

Copying "PluginName.component" to "Users/MyUserName/Library/Audio/Plug-  Ins/Components/"
make[2]: cmake: No such file or directory
make[2]: *** [PluginName.component/Contents/MacOS/PluginName] Error 1
make[2]: *** Deleting file `PluginName.component/Contents/MacOS/PluginName'

The folders exist, and the build works fine with XCode.

At the same time, CLion builds my plugin VSTs as folders with the label .vst/.vst3 instead of as bundles, and are not recognized by any host. This happens whether or not I am using the “enable copy step” option.

Bumping this? Still can’t build VST or VST3 with CLion on OSX.

Steps to reproduce:

  • In Projucer, create new project, select Audio Plugin
  • Select Xcode and CLion exporters from the wizard
  • Select “VST” and “VST3”
  • Open the project in CLion
  • Select “BUILD ALL”
    Error messages:
Copying "MyPlugin.component" to "/Library/Audio/Plug-Ins/Components/"
Error copying directory from ".../MyPlugin/Builds/CLion/cmake-build-debug/MyPlugin.component" to "/Library/Audio/Plug-Ins/Components/MyPlugin.component".
make[2]: *** [MyPlugin.component/Contents/MacOS/MyPlugin] Error 1
make[2]: *** Deleting file `MyPlugin.component/Contents/MacOS/MyPlugin'
make[1]: *** [CMakeFiles/AU.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

Copying "MyPlugin.vst" to "/Library/Audio/Plug-Ins/VST/"
Error copying directory from "../MyPlugin/Builds/CLion/cmake-build-debug/MyPlugin.vst" to "/Library/Audio/Plug-Ins/VST/MyPlugin.vst".
make[2]: *** [MyPlugin.vst/Contents/MacOS/MyPlugin] Error 1
make[2]: *** Deleting file `MyPlugin.vst/Contents/MacOS/MyPlugin'
make[1]: *** [CMakeFiles/VST.dir/all] Error 2

The issue looks like it’s in the plugin copy step, but after disabling it the .vst build still produces a folder, not a bundle. I’m now noticing that the .vst bundle is missing info.plist, PkgInfo, and Resources folder which I can see are in the .vst bundle when built with XCode

I think can workaround this by creating a post build script in the CMakeLists.txt, but then I’d have to put it there every single time I update the Projucer project…

This looks like a bug in CLion, $USER and $HOME directories are empty in the CLion terminal session.

Workaround is to use absolute paths in the projucer project for the plugin binary directories.

edit: this only fixes the plugin copy step, vst is still not building correctly.

edit 2: in the CLion terminal session, $USER and $HOME variables are empty when CLion is launched by the projucer (but not when launched normally). Not sure if this is a bug on the ROLI’s end or Jetbrains. So a second workaround is to let the projucer create the CMake project, then open CLion outside the projucer and load the project manually.

https://github.com/WeAreROLI/JUCE/commit/5c49152d9decb82ce33267b1f0d938a8c1f0b18a

https://github.com/WeAreROLI/JUCE/commit/c1af194af882145d7cdbc259e41ce36d53a04e3b

Thanks!