CMake support in the Projucer

Is this topic still active?
All I would like to see is a official way to setup juce projects using CMakeLists. Maybe something like a few macros that do all the stuff that the projucer does. For instance, collecting files, lib dependencies. Maybe spit out some compiler flags or defines that are required for juce to work. A macro that does this proxy source include thingy.
I could write this myself but I always expect that there are some “hidden” settings I would forget.

What would be nice to is to have a way to create some files to get going. The project define header, entry points for UI apps or plugins, this kind of stuff.

Would something like this be possible? Guess I’ll have to annoy some JUCE employees at ADC '18. (Oh, I’m looking forward to this!)

My motivation to use CMake mostly comes from the fact that many other projects use cmake and this makes them easy to combine. For example, using google test is a matter of one cmake-include and setting up a target for the test suit. I also would like to create a multi-project solution.

1 Like

@WilliamR: Today is your lucky day, since what you described does exist: GitHub - McMartin/FRUT: Building JUCE projects using CMake made easy

I’m the author of this project, so feel free to ask me any questions or to share with me any desires, preferably by creating an issue (Issues · McMartin/FRUT · GitHub) or by PM to avoid spamming this thread.

5 Likes

JUCE’s implementation is somewhat different to what you want: the Projucer will create the cmakelist files for you - not the other way around. Currently, it’s also limited to CLion support.

Will CLion support be extended? Currently it’s not possible to build multiple targets (without an annoying workaround) or use custom compiler flags for different configurations.

For example, you can only use the debugger in CLion with the Debug configuration or with the -g compiler flag, which means you have to edit the CMakeLists.txt file for different build configs as the Projucer doesn’t add that flag (even if “Debug Mode” is enabled) and compiler flags are set in the exporter, not each configuration.

I would also love to see generic CMake support, rather than just another exporter in the Projucer for CLion. While this exporter is much appreciated (!) I find it a pretty silly workflow to have to work in a powerful IDE like CLion for anything that doesn’t involve creating/deleting/renaming files, adding libraries, etc., but then switch back to the Projucer for these tasks. Intellij provides amazing support for auto-refactoring when making file changes (automatically renaming class names in headers and cpp files for example). It just doesn’t make sense to separate these coding tasks between two running native apps. I would really like to develop in CLion and not have to think about the Projucer, but just use the JUCE code like a library.

EDIT: I am checking out McMartin’s FRUT project for now :slight_smile:

1 Like

Bump for an official way to add CMake support as an alternative to Projucer

Like this post if you feel the same way :slight_smile:

15 Likes

Bump for this to happen in 2019 :slight_smile:

Thanks !

3 Likes

I’m on it :wink:

3 Likes

Yep, I’d love to see this too.
Due to the number of CI builds I have running these days avoiding to have to build the PJ first will be a big help. And editing it programatically (for VST2 SDK locations etc.) is likely to be easier in CMake (or you can probably use environment variables).

6 Likes

I would love the projucer to export easily to Clion

1 Like

It does easily export to Clion. I use it all the time. What is not working for you?

I think it morphed a bit into this request:

The Projucer is not very popular, since it developed from a project-setup tool Introjucer into a GUI-designer then a Live-coding environment, and now back to a project maintenance tool :wink:

Even though the other features are still present, I know…

1 Like

I tried once a while back I will try again !

I’ve made a request to use JUCE/FRUT as a hunter package: https://github.com/ruslo/hunter/issues/1764

I know next to nothing to help with this, or even guide in how to do this, so would be cool if someone can pitch in.

1 Like

I would love to have a way to generate solutions/xcode projects etc through cmake, this can really help with CI, versioning and maintaining.

Has this idea been abandoned?

I’m interested in this as well.

I have a project that uses JUCE, but we don’t use the Projucer at all and we have no .jucer file. Instead, we have a hand-written CMakeLists.txt that defines how the project should be built, and compiles both the JUCE modules with all the required flags and the project itself.

We found that using CMake instead of the Projucer as the primary project format has lots of advantages when you want smooth interoperation with other tools, continuous integration, etc.

It would be great if JUCE would provide support for this workflow! The risk I see with our approach is that the Projucer’s default-generated build settings will eventually diverge from our CMakeLists.txt and stuff will break.

1 Like

It’s certainly not abandoned. We’re experimenting with things behind the scenes to see what would work best, but having something releasable is, unfortunately, still quite a long way off. It’s a really substantial chunk of work.

4 Likes

CMake support will be added in JUCE 6 and is available now for preview:

2 Likes

If you had previously voted for this topic in the Feature Requests category you can now use your votes elsewhere.