CMake BinaryData regeneration

What is the most efficient way to force the regeneration of BinaryData in CMake builds? Specifically I have not been able to have the application icon update without deleting the entire build directory.

2 Likes

One way is to use a glob and CONFIGURE_DEPENDS to collect the files for the target, as described here: From Projucer to CMake - #3 by sudara

This is how I have it in my projects (could be seen as “dangerous” as every single file in the Assets/ folder will be bundled into the binary, so it requires some hygiene there).

file(GLOB_RECURSE AssetFiles CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/Assets/*")
juce_add_binary_data(Assets SOURCES ${AssetFiles})

# Make linux happy
set_target_properties(Assets PROPERTIES POSITION_INDEPENDENT_CODE TRUE)