The JUCE module format allows modules to contain pre-built libraries and adding such a module to a Projucer-managed project automatically sets the required linker flags to link to the library found in the module.
I now tried using such kind of module in a CMake based project like that:
juce_add_module (Ext/module_with_lib) juce_add_plugin (Plug - all the flags here –) target_link_libraries (Plug PRIVATE # JUCE Modules juce::foo juce::bar # My module module_with_lib # Recommended flags juce::juce_recommended_lto_flags juce::juce_recommended_warning_flags juce::juce_recommended_config_flags)
… and get a linker error because the lib is not found. I somehow assumed that adding the library from inside the module correctly is handled under the hood through some CMake & JUCE magic, but it doesn’t seem so. So what is missing here to make it work in a clean and cross platform style? And what about adding some lines on how to do that for other CMake beginners to the CMake Api docs?