Out-of-process rebuild: New CMakeLists.txt — builds Plugin + Helper, bundles helper inside .vst3
Browse files- CMakeLists.txt +73 -8
CMakeLists.txt
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
cmake_minimum_required(VERSION 3.22)
|
| 2 |
-
project(PluginBridge VERSION 0.
|
| 3 |
|
| 4 |
set(CMAKE_CXX_STANDARD 17)
|
| 5 |
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
| 6 |
|
| 7 |
-
# JUCE as subdirectory (git submodule)
|
| 8 |
add_subdirectory(JUCE)
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
juce_add_plugin(PluginBridge
|
| 11 |
COMPANY_NAME "PluginBridge"
|
| 12 |
BUNDLE_ID "com.pluginbridge.pluginbridge"
|
|
@@ -26,17 +29,17 @@ juce_add_plugin(PluginBridge
|
|
| 26 |
|
| 27 |
target_sources(PluginBridge
|
| 28 |
PRIVATE
|
| 29 |
-
Source/PluginBridgeProcessor.cpp
|
| 30 |
-
Source/PluginBridgeEditor.cpp
|
| 31 |
-
Source/
|
| 32 |
-
Source/
|
| 33 |
-
Source/AudioAnalyser.cpp
|
| 34 |
)
|
| 35 |
|
| 36 |
target_include_directories(PluginBridge
|
| 37 |
PRIVATE
|
| 38 |
${CMAKE_CURRENT_SOURCE_DIR}/libs
|
| 39 |
-
${CMAKE_CURRENT_SOURCE_DIR}/Source
|
|
|
|
| 40 |
)
|
| 41 |
|
| 42 |
target_compile_definitions(PluginBridge
|
|
@@ -61,3 +64,65 @@ target_link_libraries(PluginBridge
|
|
| 61 |
juce::juce_recommended_lto_flags
|
| 62 |
juce::juce_recommended_warning_flags
|
| 63 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
cmake_minimum_required(VERSION 3.22)
|
| 2 |
+
project(PluginBridge VERSION 0.2.0 LANGUAGES C CXX)
|
| 3 |
|
| 4 |
set(CMAKE_CXX_STANDARD 17)
|
| 5 |
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
| 6 |
|
|
|
|
| 7 |
add_subdirectory(JUCE)
|
| 8 |
|
| 9 |
+
# ─────────────────────────────────────────────────────────────
|
| 10 |
+
# Target 1: PluginBridge VST3/AU (the plugin loaded in DAW)
|
| 11 |
+
# ─────────────────────────────────────────────────────────────
|
| 12 |
+
|
| 13 |
juce_add_plugin(PluginBridge
|
| 14 |
COMPANY_NAME "PluginBridge"
|
| 15 |
BUNDLE_ID "com.pluginbridge.pluginbridge"
|
|
|
|
| 29 |
|
| 30 |
target_sources(PluginBridge
|
| 31 |
PRIVATE
|
| 32 |
+
Source/Plugin/PluginBridgeProcessor.cpp
|
| 33 |
+
Source/Plugin/PluginBridgeEditor.cpp
|
| 34 |
+
Source/Plugin/HelperConnection.cpp
|
| 35 |
+
Source/Plugin/McpServer.cpp
|
|
|
|
| 36 |
)
|
| 37 |
|
| 38 |
target_include_directories(PluginBridge
|
| 39 |
PRIVATE
|
| 40 |
${CMAKE_CURRENT_SOURCE_DIR}/libs
|
| 41 |
+
${CMAKE_CURRENT_SOURCE_DIR}/Source/Plugin
|
| 42 |
+
${CMAKE_CURRENT_SOURCE_DIR}/Source/Shared
|
| 43 |
)
|
| 44 |
|
| 45 |
target_compile_definitions(PluginBridge
|
|
|
|
| 64 |
juce::juce_recommended_lto_flags
|
| 65 |
juce::juce_recommended_warning_flags
|
| 66 |
)
|
| 67 |
+
|
| 68 |
+
# ─────────────────────────────────────────────────────────────
|
| 69 |
+
# Target 2: PluginBridgeHelper (standalone process, hosts plugins)
|
| 70 |
+
# ─────────────────────────────────────────────────────────────
|
| 71 |
+
|
| 72 |
+
juce_add_gui_app(PluginBridgeHelper
|
| 73 |
+
PRODUCT_NAME "PluginBridgeHelper"
|
| 74 |
+
BUNDLE_ID "com.pluginbridge.helper"
|
| 75 |
+
COMPANY_NAME "PluginBridge"
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
target_sources(PluginBridgeHelper
|
| 79 |
+
PRIVATE
|
| 80 |
+
Source/Helper/main.cpp
|
| 81 |
+
Source/Helper/HelperPluginHost.cpp
|
| 82 |
+
Source/Helper/HelperIPC.cpp
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
target_include_directories(PluginBridgeHelper
|
| 86 |
+
PRIVATE
|
| 87 |
+
${CMAKE_CURRENT_SOURCE_DIR}/libs
|
| 88 |
+
${CMAKE_CURRENT_SOURCE_DIR}/Source/Helper
|
| 89 |
+
${CMAKE_CURRENT_SOURCE_DIR}/Source/Shared
|
| 90 |
+
)
|
| 91 |
+
|
| 92 |
+
target_compile_definitions(PluginBridgeHelper
|
| 93 |
+
PRIVATE
|
| 94 |
+
JUCE_PLUGINHOST_VST3=1
|
| 95 |
+
JUCE_PLUGINHOST_AU=1
|
| 96 |
+
JUCE_WEB_BROWSER=0
|
| 97 |
+
JUCE_USE_CURL=0
|
| 98 |
+
JUCE_DISPLAY_SPLASH_SCREEN=0
|
| 99 |
+
JUCE_REPORT_APP_USAGE=0
|
| 100 |
+
)
|
| 101 |
+
|
| 102 |
+
target_link_libraries(PluginBridgeHelper
|
| 103 |
+
PRIVATE
|
| 104 |
+
juce::juce_audio_utils
|
| 105 |
+
juce::juce_audio_processors
|
| 106 |
+
juce::juce_dsp
|
| 107 |
+
juce::juce_gui_basics
|
| 108 |
+
juce::juce_events
|
| 109 |
+
PUBLIC
|
| 110 |
+
juce::juce_recommended_config_flags
|
| 111 |
+
juce::juce_recommended_lto_flags
|
| 112 |
+
juce::juce_recommended_warning_flags
|
| 113 |
+
)
|
| 114 |
+
|
| 115 |
+
# ─────────────────────────────────────────────────────────────
|
| 116 |
+
# Post-build: Copy PluginBridgeHelper into the .vst3 bundle
|
| 117 |
+
# ─────────────────────────────────────────────────────────────
|
| 118 |
+
|
| 119 |
+
add_dependencies(PluginBridge PluginBridgeHelper)
|
| 120 |
+
|
| 121 |
+
add_custom_command(TARGET PluginBridge POST_BUILD
|
| 122 |
+
COMMAND ${CMAKE_COMMAND} -E make_directory
|
| 123 |
+
"$<TARGET_BUNDLE_DIR:PluginBridge_VST3>/Contents/Resources"
|
| 124 |
+
COMMAND ${CMAKE_COMMAND} -E copy
|
| 125 |
+
"$<TARGET_FILE:PluginBridgeHelper>"
|
| 126 |
+
"$<TARGET_BUNDLE_DIR:PluginBridge_VST3>/Contents/Resources/PluginBridgeHelper"
|
| 127 |
+
COMMENT "Bundling PluginBridgeHelper inside PluginBridge.vst3"
|
| 128 |
+
)
|