I’m literally new to the framework and I’m unable to run a simple hello world VST plugin using Ubuntu 21.04 in Clion. I was able to run the project manually but I don’t know how to make the task easier.
cd JUCE/extras/Projucer/Builds/LinuxMakefile and make the projucer
cd build and executed projucer ./Projucer
Made a new project called CChords using the template Plug-in Basic
Saved the project into ~/Documents/plugin/CChords
I changed directory cd ~/Documents/plugin/CChords/Builds/LinuxMakefile and make the plugin
I built as well the AudioPluginHost following the same procedure in ~/JUCE/...
I launched from terminal AudioPluginHost and refreshed manually the plugins until I found my CChords.
On the Plug-in Host I clicked on show plugin GUI button and there it was !
Unfortunately, I was unable to set something easily with CLion for instance open the makefile project edit the source and when I hit the run button I can have everything set.
I tried to open the folder ~/Documents/plugin/CChords/ with Clion and then I was unable to build it or run it with Clion. Does anyone knows how to configure Clion with JUCE in a convenient way?
TLDR:
I’m happy to start coding with JUCE and I hope someone else use Clion on Linux
Have you added a CLion exporter to your CChords project in the Projucer? You should do this first, then save in Projucer again. Then you should have a CLion folder that you can use in CLion.
Alternately you can not use the projucer at all and instead use cmake juce 6 api which then clion will read and work with wonderfully. (All my juce projects are cmake and clion and work great in ubuntu 20.04)
However, if I save the exporter anyway and try to open ~/Documents/plugin/CChords/Builds/CLion/CMakeLists.txt as a project it is working fine. But for now, I’m not sure what this implies exactly.
However, I’m stuck for CLion configuration. How can I load the CMakelistproject in the same time as the source? This is a basic question and I’m unable to answer it by myself. This is what I tried:
Open ~/Documents/plugin/CChords/Builds/CLion/CMakeLists.txt as a project (it opens only the build directory and not the source)
Open the directory of my plugin ~/Documents/plugin/CChords/ and then I’m unable to load the CMakelists configuration
Open ~/Documents/plugin/CChords/Builds/LinuxMakefile/makefile as a project (it opens only the build directory and not the source)
This is kind of akward but setting the idea is the hardest part of the project. Getting started is a huge leap for newbie like me^^ I’m glad this forum exist and received an answer so quickly !
I think you might have better success using CMake rather than the Projucer. I remember when using the Projucer to create CLion projects I had issues with it not loading the source dirs. In most cases CLion would auto-suggest loading a top level directory which sorted the problem, but I remember being at the mercy of CLion. I don’t think you will hit these issues if you create your JUCE project with CMake to begin with.
@rory is correct. Basically “don’t use projucer use cmake”
Try this
cd (some dev directory)
git clone https://github.com/surge-synthesizer/tuning-workbench-synth.git
cd tuning-workbench-synth
git submodule update --init --recursive
then open the tuning-workbench-synth directory in CLIon. It will ask if you trust the CMakeFile - say yes - then it will load the CMakeFile and once it has you will see a target tuning-workbench-synth_Standalone on which you can press run and it will build and run
If you want a more complicated cmake config you can replace tuning-workbench-synth with surge above but follow the same procedure.
If you want to be projucer vs cmake based you will have to do something clever to use clion and I’m not sure what that is.
Oh and I had forgotten
When I was first noodling around with JUCE VST parameter automation for surge (we recently ported surge to JUCE) I wrote a tiny little parameter only toy with a super minimal cmake file.