Native, built-in CMake Support in JUCE

There’s currently no way to add a juce header to a library target. Creating the target itself can be achieved by calling add_library and then linking that library against the required JUCE modules (there’s an example here).

Note that the JUCE modules must be linked privately, in order to prevent the module sources being linked into the same target multiple times. Also, this static library should be the only source of JUCE modules for a given target. If a target links against this ‘juce static library’ target, it must not link any other JUCE modules (even transitively!) as this will cause some modules to see a reduced set of JUCE_MODULE_AVAILABLE_ flags, which may lead to ODR violations.