How to register a new exporter?


I have started to write an exporter for QtCreator. To begin with, I just used the Makefile exporter as a basis. My exporter is already partly working, means I can add it in the Introjucer and by saving I get a .pro project file with a list of sources, headers and config details.

The funny thing is that the list of sources does not include all the JUCE modules related .cpp files. I use the same findAllFilesToCompile() function as in the Makefile exporter. By debugging I could find out that there also is a JuceLibrayCode group in the QtCreator exporter, but it only contains some headers and the BinaryData.cpp.

The new exporter was registered in the createNewExporter() and createExporter() functions from the ProjectExporter class. Is there any other place I have to add it?



There should be nothing you need to apart from those functions in the jucer_ProjectExporter.cpp file.

You may have to add something to handle that folder of module files as a special case, but the other exporters all have to do the same thing, so I'm not sure what you missed when looking at the makefile one..

Mhm... ok... that is really strange. I have created a fork on github with my code:

Maybe someone has an idea what I am doing wrong?

To be a bit more precise:

When I set a break point in line 116 and 122 of the jucer_ProjectExport_QtCreator.h file

I can see the JuceLibrayCode group, but it only contains the headers AppConfig.h, JuceHeader.h, .. but no module source files.

When I debug the same lines in the Linux Makefile exporter I can see all the necessary files like. e.g. juce_core.cpp, juce_events.cpp, ...

The function to iterate over all project items and groups is exactly the same in the QtCreator exporter as in the Makefile exporter (apart from different names).

Those files should be added in LibraryModule::prepareExporter().. Can't really think why it wouldn't do so, I think you'd need to debug it and see what happens in there.

Thanks, that helps. I will take a closer look at that function.

Ok, I finally got it. I had to add a line in the LibraryModule::fileTargetMatches() function. Now all files are included as expected.

The QtCreator exporter is now basically working (compiles and runs the Introjucer project on Linux). However, it needs further testing on different OS and I still have to check if all configs are properly exported, too.