From 86da81eafb4007780796f52f77b661f7ac27b702 Mon Sep 17 00:00:00 2001 From: Matt Firth Date: Sun, 17 Mar 2024 20:14:57 +0000 Subject: [PATCH] Copy setup resources in to bundle as post build step This allows for testing of the setup application without needed packaging --- tools/setup/CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tools/setup/CMakeLists.txt b/tools/setup/CMakeLists.txt index 6eeac242..48e186be 100644 --- a/tools/setup/CMakeLists.txt +++ b/tools/setup/CMakeLists.txt @@ -91,6 +91,57 @@ add_custom_command(TARGET setup PRE_BUILD COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/helpers/gen_license_header.cmake ) +if(APPLE) + + # Setup needs all the bits of the EPS in the Resources of the bundle to work + # - copy all in to the bundle as a post-build step which will allow for testing without needing packaging + + add_dependencies(setup ${EPS_PLUGIN_TARGETS}) + add_dependencies(setup adm_export_source_VST3) + add_dependencies(setup project_upgrade_gui project_upgrade) + add_dependencies(setup reaper_adm) + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory $ $/Resources/VST3/$ + ) + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory $ $/Resources/Tools/$ + ) + + foreach(TGT IN LISTS EPS_PLUGIN_TARGETS) + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory $ $/Resources/VST3/ear-production-suite/$ + ) + endforeach() + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ $/Resources/Tools/ + ) + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy $ $/Resources/UserPlugins/$ + ) + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/reaper-adm-extension/src/reaper_adm/ADMPresets $/Resources/UserPlugins/ADMPresets + ) + + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/packaging/Templates $/Resources/Templates + ) + + # Setup requires LICENSE.pdf and README.pdf but these only get generated during packaging + # Just put blank files in for now + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E touch $/Resources/LICENSE.pdf + ) + add_custom_command(TARGET setup POST_BUILD + COMMAND ${CMAKE_COMMAND} -E touch $/Resources/README.pdf + ) + +endif() + set_target_properties(setup PROPERTIES FOLDER tools) target_link_libraries(setup PRIVATE Juce::core ear-version) target_include_directories(setup PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${EPS_SHARED_DIR})