Good morning. I’ve been on a journey moving my plugins from Projucer to CMake and it’s been interesting to say the least. Lots of bumps here and there, but I’ve received a lot of help from the AudioProgrammer Discord channel, especially from @benvining and @eyalamir.
First, I have to say that I’ve found the available documentation, examples and tutorials for CMake pretty obtuse, unclear and quite sparse. @benvining has a few YouTube videos that were helpful, but in many ways, it’s like learning a completely new programming language (which it is) from scratch. And with all that power, there are many ways to do anything and everyone seems to have their own way of doing things. Shocking, I know.
That being said, I’ve finally gotten to the point where my CMake workflow is working well using CLion on both Mac and Windows, and I’m able to produce proper release plugins and a standalone app on Mac (Windows is next). Now I’m moving on to creating installers and that’s really where the online help falls off a cliff. Creating installers is hard enough and unfortunately, CMake/CPack seem to be fairly lacking the full feature set needed to do the job. CMake-copy-plugin-after-build-clion-and-building-plugin-installers-with-cpack also confirms what I’ve found. Googling didn’t reveal much help out there either.
So it looks like I’ll be using some version of a my original shell script that creates the Mac installer, but to do that, I need to know where CMake created the release versions of my plugins and app without hardcoding them. Digging through the JUCE CMake files, it looks like these lines should point to those files:
get_target_property(aax_dest "MyPlugin_AAX" JUCE_PLUGIN_ARTEFACT_FILE) get_target_property(vst_dest "MyPlugin_VST" JUCE_PLUGIN_ARTEFACT_FILE) get_target_property(vst3_dest "MyPlugin_VST3" JUCE_PLUGIN_ARTEFACT_FILE) get_target_property(au_dest "MyPlugin_AU" JUCE_PLUGIN_ARTEFACT_FILE) get_target_property(app_dest "MyPlugin_Standalone" JUCE_PLUGIN_ARTEFACT_FILE)
But when I print those variables out, I get this:
AAX = $<GENEX_EVAL:$<TARGET_PROPERTY:MyPlugin,LIBRARY_OUTPUT_DIRECTORY>>/AAX/$<TARGET_PROPERTY:MyPlugin,JUCE_PRODUCT_NAME>.aaxplugin VST = $<TARGET_BUNDLE_DIR:MyPlugin_VST> VST3 = $<GENEX_EVAL:$<TARGET_PROPERTY:MyPlugin,LIBRARY_OUTPUT_DIRECTORY>>/VST3/$<TARGET_PROPERTY:MyPlugin,JUCE_PRODUCT_NAME>.vst3 AU = $<TARGET_BUNDLE_DIR:MyPlugin_AU> APP = app_dest-NOTFOUND
I’m guessing that the difference here is that AAX and VST3 are actually folders. What I don’t understand is why there’s no standalone app? I can see the actual app in the folder, but that CMake line does not give me the path to the app. Any ideas, @reuk? Is there a better command to obtain the path to these products? Maybe JUCE could provide a CMake command to help out here.
If anyone has any ideas here, jump in, the water’s warm.