Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: Allow generated files to be included in juce_add_binary_data #967

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

piem
Copy link

@piem piem commented Nov 14, 2021

This trivial patch allows one to include generated files in the list of SOURCES of juce_add_binary_data.

Example:

# create a zip of dir foo/
add_custom_command(COMMAND
    ${CMAKE_COMMAND} -E tar "cfv" "foo.zip" --format=zip
    "${CMAKE_CURRENT_DIRECTORY}/foo/"
)
# create a custom target for it
add_custom_target (FooZip DEPENDS "foo.zip")
# create juce binary data
juce_add_binary_data(FooData
    NAMESPACE FooData
    HEADER_NAME FooData.h
    SOURCES "${CMAKE_CURRENT_BINARY_DIR}/foo.zip"
)
# let it depend on FooZip target
add_dependencies (FooData FooZip)

Another way to do it would be to add a DEPENDS argument to keep the _and_check on SOURCES, but it doesn't seem required since juceaide will error on missing files anyhow.

cheers, piem

@piem piem force-pushed the fix/generated_binary_data branch 2 times, most recently from b0fbae8 to b3fc623 Compare December 23, 2021 20:04
@benthevining
Copy link

Bump! I would like this feature :-)

@piem piem force-pushed the fix/generated_binary_data branch from b3fc623 to 73b3746 Compare February 2, 2022 11:23
@piem piem force-pushed the fix/generated_binary_data branch from 73b3746 to 8871fff Compare March 1, 2022 11:23
@piem piem force-pushed the fix/generated_binary_data branch from 8871fff to 1a0eacb Compare June 27, 2022 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants