Multi-target exporters


#1

Is there a way to define my own targets for projects in the projucer without creating a separate exporter?

For example is there an easy way for me to build an application and unit tests for that application in different executables?


#2

You could add another build configuration to your exporter with a preprocessor define that you could then use to compile different code based on the config you are building. You can also change the “Binary Name” setting of the build config to create a binary with a different name.


#3

That works fine, thank you!

It would be very helpful in the future however to have something like XCode’s “New -> Target” or CMake’s add_executable to create multiple targets and one “build all” configuration, like with the plugin exporters.


#4

Just a heads up though: in CLion when you add a new build configuration with debugging enabled you need to add -g to target_compile_options in CMakeLists.txt. Copying the XCode Debug configuration does not account for that, and there’s no place to add an additional compiler argument in a new build configuration for a given exporter.