I have created a new VST3 plugin with the VST3_Project_Generator.app on a M1 MacBook. It creates a “resource” folder. And in CMakeLists.txt there is:
Now I want to add files to my Xcode project, ie. some WAV files and a background.png for use in VSTGUI: When I pick a PNG it adds the full path in editor.uidesc. And it seems to look fine, but I can see that the PNG is not bundled as part of the plugin itself, instead it points to the original file in my local file system.
How can I ensure that the files are shipped as part of the plugin, ie. that they are really part of the plugin, so that my users can see what I see?
Is it required to add my files to smtg_target_add_plugin_resources? And how?
Answering myself: I did the following steps that seem to be necessary to include an asset to the “resource” folder (not “Resources”!):
- Add file to CMakeLists.txt:
Now build the project. The asset will appear in Xcode in the “Resources” folder.
In VSTGUI: Add the PNG, but not with absolute path, instead just type the file name (no path): “back.png”. Select the entry. In JSON it looks like this:
Now after rebuilding the project the file finally appears in the “resource” folder of the plugin: “/Users/MyName/Dev/VST_SDK_MY_PROJECTS/MyPluginName/build/VST3/Debug/MyPluginName.vst3/Contents/Resources/back.png” - it does, however, not appear in the project folder itself, so it will be missing when using version control, so probably it makes sense to copy the file to the project folder beforehand, e.g. top-level.
Not sure if this is the recommended way or not, but at least it seems to work.