Export with multiple module settings

Hi all,

What's the recommended way in Introjucer to export two different targets with different Juce module settings?

Specifically: I have a program that I want to build as a GUI application or as a command-line tool. In the GUI case, I need OpenGL and the Juce GUI modules. In the command-line case, I don't want dependencies on any of those things so it can compile straightforwardly even without X11. I am fine for this decision to be made at compile time, I don't need a single executable that does both.

In my code, I set an #ifdef which disables the GUI and enables command-line input. This is fine and I can build both ways. However, Introjucer does not appear to let me choose different module settings for different exporters. Creating two .jucer files in the same directory creates conflicts.

What's the best, most maintainable solution? Is there a way to do this within one Introjucer project, or should I maintain two separate directories and two Introjucer projects? (Apologies if this has been answered elsewhere, couldn't find a good answer in previous posts.)

Thanks, Andrew

Hmm, tricky one. I don’t think there’s currently any easy way to do this with the Introjucer as the module settings and therefore generated AppConfig files are project specific. I think I would just create two separate Introjucer projects but have them share the main source code and JUCE modules.

When you say creating two .jucer files in the same directory causes conflicts what exact conflicts are these? I’ve done something similar in the past without problems. In my case I created a separate Introjucer project that builds another project as just a couple of “unity build” files which really sped up build times in my Windows VM.

The main problem here is keeping the two projects in sync so if you add files or settings to one you don’t want to have to do the same to the other. It’s a bit of a hack but you could do something similar to me by writing a small command line app that parses your ‘master’ project and generates the new non-gui version here’s my post and associated links on the Unity Builder.

You’ll probably have to end with a directory structure something like: