Skip to content

Commit a1c94d2

Browse files
committed
Automatically glob assets for inclusion from /assets folder
1 parent 1f668d6 commit a1c94d2

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

CMakeLists.txt

+15-12
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ include (PamplejuceVersion)
88

99
# Change me!
1010
# This is the internal name of the project and the name of JUCE's shared code "target"
11-
# Note: This cannot have spaces. It may be 2023, but you can't have it all.
12-
# Worry not, JUCE's PRODUCT_NAME can have spaces (and is external facing).
11+
# Note: This cannot have spaces (it may be 2023, but you can't have it all!)
12+
# Worry not, JUCE's PRODUCT_NAME can have spaces (and is DAWs display)
1313
# You may want to append the major version on the end of this (and PRODUCT_NAME)
1414
# set(PROJECT_NAME "MyPlugin_v${MAJOR_VERSION}")
1515
# Doing so enables major versions to show up in IDEs and DAWs as separate plugins
16-
# allowing you to change parameters and behavior without breaking user projects
16+
# allowing you to change parameters and behavior without breaking existing user projects
1717
set(PROJECT_NAME "Pamplejuce")
1818

19+
# Change me! Used for the MacOS bundle identifier
1920
set(BUNDLE_ID "com.pamplejuce.pamplejuce")
2021

21-
# Set the plugin formats you'll be building here.
22-
# Valid choices here: AAX Unity VST VST3 AU AUv3 Standalone
22+
# Change me! Set the plugin formats you want built
23+
# Valid choices: AAX Unity VST VST3 AU AUv3 Standalone
2324
set(FORMATS Standalone AU VST3 AUv3)
2425

2526
# For simplicity, the name of the CMake project is also the name of the target
@@ -37,7 +38,7 @@ include(JUCEDefaults)
3738
# On Github Actions, this is done as a part of actions/checkout
3839
add_subdirectory(JUCE)
3940

40-
# Add your modules here
41+
# Add any other modules you want modules here, before the juce_add_plugin call
4142
# juce_add_module(modules/my_module)
4243

4344
# This adds the melatonin inspector module
@@ -52,7 +53,7 @@ juce_add_plugin("${PROJECT_NAME}"
5253
COMPANY_NAME Pamplejuce
5354
BUNDLE_ID "${BUNDLE_ID}"
5455

55-
# On MacOS, plugin is copied to ~/Users/you/Library/Audio/Plug-Ins/
56+
# On MacOS, plugin is copied to ~/Users/yourname/Library/Audio/Plug-Ins/
5657
COPY_PLUGIN_AFTER_BUILD TRUE
5758

5859
# Change me!
@@ -91,9 +92,10 @@ target_sources(SharedCode INTERFACE ${SourceFiles})
9192
# Adds a BinaryData target for embedding assets into the binary
9293
include(Assets)
9394

94-
# MacOS only: Clean up folder organization on Xcode.
95-
include(Xcode)
95+
# MacOS only: Cleans up folder and target organization on Xcode.
96+
include(XcodePrettify)
9697

98+
# This is where you can set preprocessor definitions for JUCE and your plugin
9799
target_compile_definitions(SharedCode
98100
INTERFACE
99101

@@ -113,10 +115,11 @@ target_compile_definitions(SharedCode
113115
PRODUCT_NAME_WITHOUT_VERSION="Pamplejuce"
114116
)
115117

116-
# Usually JUCE modules should have PRIVATE visibility
118+
# Link to any other modules you added (with juce_add_module) here!
119+
# Usually JUCE modules must have PRIVATE visibility
117120
# See https://github.com/juce-framework/JUCE/blob/master/docs/CMake%20API.md#juce_add_module
118-
# However, with Pamplejuce, you will link your modules to SharedCode with INTERFACE visibility
119-
# This allows JUCE targets and the Tests target to link against it
121+
# However, with Pamplejuce, you'll link modules to SharedCode with INTERFACE visibility
122+
# This allows the JUCE plugin targets and the Tests target to link against it
120123
target_link_libraries(SharedCode
121124
INTERFACE
122125
Assets

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![PAMPLEJUCE](pamplejuce.png)
1+
![PAMPLEJUCE](assets/images/pamplejuce.png)
22
[![](https://github.com/sudara/pamplejuce/workflows/Pamplejuce/badge.svg)](https://github.com/sudara/pamplejuce/actions)
33

44
Pamplejuce is a ~~template~~ lifestyle for creating and building JUCE plugins in 2023.
File renamed without changes.

cmake/Assets.cmake

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# HEADS UP: Pamplejuce assumes anything you stick in the assets folder you want to included in your binary!
2+
# This makes life easy, but will bloat your binary needlessly if you include unused files
3+
file(GLOB_RECURSE AssetFiles CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/assets/*")
4+
15
# Setup our binary data as a target called Assets
2-
juce_add_binary_data(Assets SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/pamplejuce.png)
6+
juce_add_binary_data(Assets SOURCES ${AssetFiles})
37

48
# Required for Linux happiness:
59
# See https://forum.juce.com/t/loading-pytorch-model-using-binarydata/39997/2
File renamed without changes.

0 commit comments

Comments
 (0)