CLion and JUCE in 2021?

Hi folks, I’m trying to figure out whether I should use CLion (free grad school license!), but it seems like all the CLion posts on here are several years old, and maybe CLion projucer integration got abandoned? Just curious to find out what the state of the nation is on this, whether people do it, if so, how they do it, is it worth the setup, etc. At the moment I’m just editing in MacVim and compiling in XCode, so there must be better ways of working than that, haha

thanks!

It seems that the CMake approach is more and more popular nowadays. I doubt that adding more exporters to the Projucer is onto the top of the JUCE team jobs (correct me if i’m wrong).

Our whole team switched to CLion during the last year and it works great, but we are using it with the native CMake support added to JUCE since version 6, this means no more Projucer but directly creating the projects via plain CMake.

Since CMake is basically designed to do the same as the Projucer – managing cross-platform C++ projects that can be exported to various IDE projects or build systems using the Projucer as a tool to create a CLion specific CMake project just adds an extra layer of complexity that is no longer needed with native CMake support, this is why posts about the CLion exporter are all a bit older.

To get started with a basic plugin or application you don’t need to be a CMake expert, just have a look at the CMake examples to find some starting point that you can tweak to your needs with the information supplied in the CMake API documentation.

9 Likes

Just a +1 for CLion and JUCE (via CMake). We switched all projects to use this setup as soon as it was stable, and we’ve not looked back. We only use Projucer now for small demo projects.

4 Likes

Thanks everyone, that sounds like a good path for me to explore.

Does anyone have suggestions on best resources for learning CMake for beginners? (books, sites, etc.)

Hi @iainduncan !

I suppose that @PluginPenguin already gave you an answer:

Here there is also a video on The Audio Programmer channel about the CMake and Juce 6 functionalities: https://www.youtube.com/watch?v=FKVK7TyEJ5g
Here there is a repo that you can clone to create basic (GUI app, plugins, console app) projects based on JUCE + CMake config: GitHub - eyalamirmusic/JUCECmakeRepoPrototype: A prototype to model a way to create an entire repo using JUCE6 and CMake.
(For these two, we need to thank also @eyalamir :slight_smile: )

Here you can find an open-source plugin made by @PluginPenguin, which is based on CMake config: GitHub - JanosGit/Schrammel_OJD: Audio plugin model of a modern classic guitar overdrive Pedal
(I need also to thank @PluginPenguin, because I learnt a lot with his plugin code and his brilliant post on the forum :slight_smile: )

Here there is one of my plugin based on CMake config: GitHub - maurizdeb/CutTheMooog: Repo of the audio plugin of the Lockhart Wavefolder and the Moog Filter

Hope that this helps :slight_smile:

1 Like

Thanks, those will be helpful!

I develop surge in CLion every day. If you want to see a bigger open source synth which uses juce cmake and works great in CLion GitHub - surge-synthesizer/surge: Synthesizer plug-in (previously released as Vember Audio Surge) at head is a pair of juce plugins and a bunch of integrated libraries.

Editorial - I used emacs for 25+ years and CLion is the first environment that succeeded in breaking me out of it.

3 Likes

Thanks! haha, yeah Intellij makes good kit. I’m a die hard vim user, with all the muscle memory and macros and so on, and Pycharm was the first IDE I adopted. Especially because the vimulation is actually very good!

iain

@adamwilson Do you guys use CLion on Windows and Mac now instead of VS and Xcode?

For Windows, CLion is slightly more annoying to set up: you need to have Visual Studio installed too to avoid using MinGW as a compiler, and add -G Ninja to the cmake settings, as otherwise builds are too slow.

Other than that I’ve also switched to that for Mac, Windows and Linux, which is really nice because as much as I love Visual Studio, using the same IDE makes my brain adjust better when I have to switch environments.

For iOS, we still have to use Xcode or AppCode.

1 Like

We also use CLion on Windows and Mac for plugin development and dropped Xcode and VisualStudio.

Just to add a few thoughts: We are also using Ninja on macOS. While we are currently also still using MSVC as installed with VisualStudio for our Windows builds, @vallant made great success using a vanilla llvm based clang toolchain that should not even need a Visual Studio installation anymore to build our plugins. We’ve not yet taken this step, but we will likely do so in near future. This would then mean CMake + CLion + Ninja + Clang on both macOS and Windows, which we expect to be a great thing this will make the differences between the target platform very little.

1 Like

@PluginPenguin, did you feel a speed boost with Ninja on Mac?

TBH I’m also using it in my CI builds, just because it simplifies having the exact same CMake commands on all platforms, but in my manual benchmarks the default Mac generator (Unix makefiles) was always faster so I preferred it for development.

I never really benchmarked Ninja vs Unix Makefiles speed on macOS, in our largest project which takes more than 10 minutes for a complete build I got the feeling that Ninja was slightly faster, but this is just a feeling tbh. If make is faster then it won’t be a lot. But maybe I’ll do some benchmarking later here as well :wink:

Using Ninja also on macOS is more for the sake of using the same environment everywhere as far as possible.

2 Likes

To be fair, you’ll still need the Windows 10 SDK though :wink:
@eyalamir I think that the speedup will not be really noticeable, i guess that the limiting factor will still be the compiler/linker used… I cannot imagine that xcodebuild or msbuild are that much slower nowadays…
As you said, i also see the main benefit in having a unified build environment.

Ninja is certainly faster than MSbuild on my machine. Actually, even Visual Studio now uses it by default if you load a CMake project.

Xcode is a little faster than Ninja on my machine.

But - both of these aren’t the default CMake generators. On Mac it’s Unix Makefiles and on Windows it’s NMake or something like that…

How much faster builds are you experiencing?

I haven’t measured in a while. But on Windows it was much faster, a dramatic increase from MSBuild using the same project.