sudara / pamplejuce

A JUCE audio plugin template. JUCE 7, Catch2, Pluginval, macOS notarization, Azure Trusted Signing, Github Actions
https://melatonin.dev/blog/
MIT License
372 stars 36 forks source link

Best practice to add a bunch of assets from dropbox for inclusion in binary content? #71

Closed 7sharp9 closed 1 month ago

7sharp9 commented 5 months ago

Hi, Im using this template and Ive come to a point where theres a bunch of content in DropBox that I have to include so that they becomre binary assets from juce. The question whats the best way for inclusion?

The best Ive come up with so far is just a bunch of File(DOWNLOAD steps to place the files in "${CMAKE_BINARY_DIR}/assets/" and then add this path to the existing assets script:

file(GLOB_RECURSE AssetFiles CONFIGURE_DEPENDS 
    "${CMAKE_CURRENT_SOURCE_DIR}/assets/*"
    "${CMAKE_BINARY_DIR}/assets/*")

I was curious if this was something you had come across and potentially had a better solution?

Thanks! Dave.

7sharp9 commented 5 months ago

Or even better leave the local ones as they are in the template and just add another binary target:

# Adds a BinaryData target for embedding assets into the binary from dropbox
file(GLOB_RECURSE DropboxAssetFiles CONFIGURE_DEPENDS "${CMAKE_BINARY_DIR}/assets/*")
juce_add_binary_data(DropboxAssets SOURCES ${DropboxAssetFiles})

_With a little python script that downloads them and places them at ${CMAKE_BINARY_DIR}/assets/*._ This is what Ive done unless you have another smarter way :-)

sudara commented 5 months ago

Hey @7sharp9,

Hey, good question. I guess if you only care about it working on your machine, you can just specify the path relative from your project folder and skip all the DOWNLOAD stuff. If it's supposed to be reproducible on multiple machines.... hm.... I guess you'd probably need a way to grab the download folder's location on the local machine?

You could always ask around on the discord. I'm not sure there's value in them being in their own target (unless the point is they change often and you don't want to recompile the other stuff?)