3.- I added the add_subdirectory(Images)
line in the root CMakeLists.txt document, so the Images folder gets included
4.- I’ve also added the WanalogBinaryData to the linking phase like this:
target_link_libraries(WanalogAudioPlugin PRIVATE
WanalogBinaryData # If we'd created a binary data target, we'd link to it here
juce::juce_audio_utils
juce::juce_dsp)
I see that the Binary data .o file is being compiled properly.
My question is… How can I now access this bynary data on source code?
If you’re using a JuceHeader, then the binary data header should be automatically included in there. If you’ve opted to avoid the JuceHeader (recommended), you can just #include BinaryData.h in the places that you need it.
Let me know if that doesn’t work, and I’ll try to find out what’s going wrong.
Yes, it worked!
The IDE was marking the BinaryData in red as unresolved symbol, which was confusing me but when I compile, it works, so I guess it’s the IDE not being able to resolve symbols.
Thanks!
Glad you got it working! This might be because the BinaryData files are generated during the build, so the IDE may not be able to find them until the build has been run once (and even then, some IDEs might need a bit of a nudge to re-index the binary directory…)
Quick follow up question: What is the syntax for using the juce_add_binary_data in a cmakelists.txt file in another folder? Cmake is saying it does not recognize the function, do I need to add something from the juce library to use that function?