JuMake - setup Juce Projects with CMake

JuMake: CMake Project Setup for JUCE Development

Hi everyone,

I’m excited to share a new command-line tool I’ve been working on called JuMake. It’s designed to make setting up new JUCE projects with CMake faster and easier, especially for those who are new to CMake or want a more streamlined workflow.

Here’s what JuMake does:

  • Creates a new project directory: You can specify the project name and an optional path.

  • Generates a basic CMakeLists.txt file: Tailored for JUCE development.

  • Creates a src directory with template C++ files: Including Main.cpp, MainComponent.cpp, and MainComponent.h.

  • Initializes a Git repository: So you can start version control right away.

  • Clones JUCE as a submodule: Automatically fetches the JUCE framework and integrates it into your project.

  • Handles platform differences: Works seamlessly on Windows, macOS, and Linux.

Here’s how to use it:

  1. Install Rust: If you don’t have it already, get it from https://www.rust-lang.org/.

  2. Install JuMake: cargo install jumake

  3. Create a new project: jumake new MyJuceProject

  4. Build the project: cd MyJuceProject && jumake build

  5. Run the project: jumake run

  6. Add new classes: jumake add class MyNewClass or jumake add component MyNewComponent

Current Features:

  • Support for GUI Application, Audio Plugin, and Console App templates.

  • Build type selection (Debug, Release, etc.).

  • Automatic JUCE submodule management.

  • Add new classes and components to your project.

I’d love to get your feedback! Try out JuMake and let me know what you think. I’m open to suggestions, feature requests, and contributions.

You can find the project on GitHub: https://github.com/BaraMGB/JuMake/
Thanks!
Steffen

5 Likes

I made a Video for showing JuMake:

YOUTUBE

Looks cool, I’ll give it a try on a new project soon and see how far it goes …

Hi I’m Riccardo, we wrote each other on youtube. I did several tests on Vs code terminal on windows and it always gives me the same errors, here is the link to the file with all the logs 663 KB file on MEGA. Then I created a new project and tried to do the build process with Visual studio and projucer and it gave no problems. I think it could be JUCE 8.0 that is little different from previous versions, for example src filesare called Main.cpp and MainComponent.cpp, but idk

I guess, the problem is that you have installed minGW, too. And cmake choose that in favor of the Microsoft Compiler. I have to investigate on this. Thank you for testing. :smiling_face::+1:t2:

UPDATE
According to chatgpt, "The error you are experiencing occurs because the project compilation uses MinGW, which is no longer supported by JUCE. In the file juce_TargetPlatform.h, there is an explicit warning informing you that support for MinGW has been removed and advising you to use an alternative compiler

warning: Support for MinGW has been removed. Please use an alternative compiler."

I actually installed MinGW for projects outside JUCE and I think it uses that by default.

How I solved it:

  1. I removed MinGW from the environment variables
  2. I installed MSVN from https://aka.ms/vs/17/release/vs_BuildTools.exe also installed Git and CMake (from the site choose binaries)
  3. I added the relevant paths as environment variables and checked the versions in the powershell (for MSVN just type cl)
  4. I followed the commands as described on the Jumake github (to be precise I only did ‘jumake run’ because I had already created a project)

My audio application works correctly

1 Like

That’s great news. Actually ‘jumake run’ will build the project too. :+1:t2:. I need to force cmake to use the Microsoft Compiler. Or at least give a warning. Need to test that. Thank you for the update.

I made one change: I put in the user variables in “path” the path to MSVN and in the system variables in “path” the path to minGW. Both compilers work and jumake uses MSVN. It worked for me, I have Windows 10.

Hi Steffen, as someone who has struggled to get his head around CMake for a while already, I have to say this worked perfectly for me! It’s super easy to install and to use, and I’m just really happy I found this post. Awesome work!

Juan

I’m glad it helps. :grin::+1:t2: