GithubHelp home page GithubHelp logo

sudara / pamplejuce Goto Github PK

View Code? Open in Web Editor NEW
385.0 12.0 37.0 2.26 MB

A JUCE audio plugin template. JUCE 7, Catch2, Pluginval, macOS notarization, Azure Trusted Signing, Github Actions

Home Page: https://melatonin.dev/blog/

License: MIT License

CMake 28.68% C++ 61.51% Inno Setup 9.81%
juce juce-framework cmake catch2 audio plugin template code-signing

pamplejuce's Introduction

PAMPLEJUCE

Pamplejuce is a template lifestyle for creating and building JUCE plugins in 2024.

Out of the box, it:

  1. Supports C++20.
  2. Uses JUCE 7.x as a git submodule (tracking develop).
  3. Relies on CMake 3.24.1 and higher for cross-platform building.
  4. Has Catch2 v3.6.0 for the test framework and runner.
  5. Includes a Tests target and a Benchmarks target some examples to get started quickly.
  6. Has Melatonin Inspector installed as a JUCE module to help relieve headaches when building plugin UI.

It also has integration with GitHub Actions, specifically:

  1. Building and testing cross-platform (linux, macOS, Windows) binaries
  2. Running tests and benchmarks in CI
  3. Running pluginval 1.x against the binaries for plugin validation
  4. Config for installing Intel IPP
  5. Code signing and notarization on macOS
  6. Windows code signing via Azure Trusted Signing

It also contains:

  1. A .gitignore for all platforms.
  2. A .clang-format file for keeping code tidy.
  3. A VERSION file that will propagate through JUCE and your app.
  4. A ton of useful comments and options around the CMake config.

How does this all work at a high level?

If you are new to CMake, I suggest you read up about JUCE and CMake on my blog!.

Can I see some examples?

Lots of people have used Pamplejuce as their starting place for their private plugin projects.

Two amazing public examples (complete with signed binaries) are:

  • Valentine, a compressor plugin by Jose Diaz Rohena
  • Maim, an mp3 distortion plugin by Arden Butterfield

Setting up for YOUR project

This is a template repo!

That means the easiest thing to do is click "Use this template" here or at the top of the page to get your own repo with all the code here.

After you've created a new repo from the template, you have a checklist of things to do to customize for your project.

  • git clone your new repo (if you make it private, see the warning below about GitHub Actions minutes)

  • Download CMAKE if you aren't already using it (Clion and VS2022 both have it bundled, so you can skip this step in those cases).

  • Populate the JUCE by running git submodule update --init in your repository directory. By default, this will track JUCE's develop branch, which is a good default until you are at the point of releasing a plugin. It will also pull in the CMake needed and an example module, my component inspector.

  • Replace Pamplejuce with the name of your project in CMakeLists.txt where the PROJECT_NAME variable is first set. Make this all one word, no spaces.

  • Adjust which plugin formats you want built as needed (VST3, AU, etc).

  • Set the correct flags for your plugin juce_add_plugin. Check out the API https://github.com/juce-framework/JUCE/blob/master/docs/CMake%20API.md and be sure to change things like PLUGIN_CODE and PLUGIN_MANUFACTURER_CODE and everything that says Change me!.

  • Build n' Run! If you want to generate an Xcode project, run cmake -B Builds -G Xcode. Or just open the project in CLion or VS2022. Running the standalone might be easiest, but you can also build the AudioPluginHost that comes with JUCE. Out of the box, Pamplejuce's VST3/AU targets should already be pointing to it's built location.

  • If you want to package and code sign, you'll want to take a look at the packaging/ directory add assets and config that match your product. Otherwise, you can delete the GitHub Action workflow steps that handle packaging (macOS will need code signing steps to work properly).

This is what you will see when it's built, the plugin displaying its version number with a button that opens up the Melatonin Inspector:

Pamplejuce v1 - 2023-08-28 41@2x

FAQ

Tip

Don't see your question here? Open an issue!

Where do I put new .h / .cpp files?

New source files go in /source. All .h and .cpp files in that directory will be available to include in your plugin target and your tests.

Tests go in /tests. Just add .cpp files there and they will be available in the Tests target.

Note

If you use an overeager, CMake-aware IDE (like CLion) it might prompt you to manually add files to a CMake target. This is not needed.

Preview - 2023-11-25 34@2x

I recommend not stuffing everything into the boilerplate PluginEditor/PluginProcessor files. Sure, go ahead make a mess at first. But then clean them up and just include your source from there.

How do I add another module?

Additional 3rd party JUCE modules go in /modules. You can add third party git submodules there (like the inspector is set up). Remember to not only call juce_add_module but add it to the target_link_libraries list!

I (and others, including some of the JUCE team) recommend moving as much as your application code into modules as possible. For example, if you tend to roll your own widgets, pop those into a module, you'll thank yourself later.

A few reasons to do so:

  • Re-usability. You can use modules across projects.
  • Testability. You can test modules in isolation from each other. When sticking test in modules, it's common to guard .cpp files with something like #ifdef RUN_MY_TESTS and set via target_compile_definitions in Tests target.
  • Sanity. You can keep the root project tidy, focused on the application logic.
  • Compile-friendliness. Each JUCE module is its own compilation unit. If you change a file in a module, only that one module needs to rebuild. It also means you can work on only the module in a separate CMake project, which is a very nice/fast life.

Don't worry about all of this if you are new to JUCE. Just keep it in mind as you grow.

What's the deal with BinaryData?

Your binary data CMake target is called Assets.

You need to include BinaryData.h to access it.

Important

You may have to configure the project (just hit build in your IDE) to build juceaide before the header will be available.

How I get clang-format working

There are a huge number of benefits to automatic formatting of code, including the very obvious one of guaranteed consistency and therefore readability. But it also saves brain cycles and can prevent team bike-shedding.

@CrushedPixel, who prompted me to write this FAQ entry says

Formatting is a really key component and you’re providing it out of the box. I have learned to swallow my pride when it comes to my own preferences, so I’m okay as long as I can just hit save and the IDE does the deed for me

The included .clang-format file will get you very close to the JUCE style guide.

On CLion, see this guide on how to clang format on save or on key command (my preference).

On VS 2022, it's enabled by default.

On Xcode, see this plugin (disclaimer, when I was still using Xcode I couldn't find a great solution, which is part of why I switched to CLion).

What's the deal with code signing and notarization?

This repo code signs Windows via Azure Trusted Signing. Read more about how to set it up on my blog.

It also code signs and notarizes on macOS. Again, you can read my article for details.

How do I update my Pamplejuce-based project?

  1. Update with the latest CMake version listed here, or the latest version supported by your toolchain like VS or Clion.
  2. Update JUCE with git submodule update --remote --merge JUCE
  3. Update the inspector with git submodule update --remote --merge modules/melatonin_inspector
  4. Check for an IPP update from Intel.
  5. If you want to update to the latest CMake config Pamplejuce uses, first check the repository's CHANGELOG to make sure you are informed of any breaking changes. Then. git submodule update --remote --merge cmake. Unfortunately, you'll have to manually compare CMakeLists.txt, but it should be pretty easy to see what changed.

How to Cut A GitHub Release

Cut a release with downloadable assets by creating a tag starting with v and pushing it to GitHub. Note that you currently must push the tag along with an actual commit.

I recommend the workflow of bumping the VERSION file and then pushing that as a release, like so:

# edit VERSION
git commit -m "Releasing v0.0.2"
git tag v0.0.2
git push --tags

Important

If you see a 403 error, you'll need to adjust the repository permissions. Go to Settings > Acitions > General > Workflow Permissions and choose Read and Write.

Important

Releases are set to prerelease! This means that uploaded release assets are visible to other users (on public repositories), but not explicitly listed as the latest release until you "publish" in the GitHub UI.

Note

I would like the release process to be easier. I'm open to suggestions, please read the options and provide feedback.

How do I add private github repos as JUCE modules?

Generate an ssh key (without a passphrase) for the repository and add it as a secret to your Pamplejuce-derived repository.

Then, use the ssh_key option in the checkout action, like so:

- name: Checkout code
  uses: actions/checkout@v3
  with:
    ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
    submodules: true # Get JUCE populated

Also see @mikelange49's solution here.

I'm new to GitHub Actions, what do I need to know?

CI will run against latest Linux, Windows, and macOS unless modified. You can do it all for free on public repos.

For private repos, be sure to do some calculations about free minutes vs. costs on running in CI.

Warning

GitHub gives you 2000 or 3000 free GitHub Actions "minutes" / month for private projects, but they actually bill 2x the number of minutes you use on Windows and 10x on MacOS.

You might feel disincentivized to push to private repos (as you would burn through minutes). By default, multiple commits in quick succession will cancel any earlier running builds. There are also timeouts set so you can't accidentally stall a build and burn through time.

Note

You can push a commit with [ci skip] in the message if you are just doing things like updating the README or checking in a WIP that you know will fail CI.

You have a few other big picture options, like doing testing/pluginval only on linux and moving everything else to Release only. The tradeoff is you won't be sure everything is happy on all platforms until the time you are releasing, which is the last place you really want friction.

How do variables work in GitHub Actions?

It can be confusing. The documentation is a big fragmented. Here are some tips.

  1. Things in double curly braces like ${{ matrix.name }} are called "contexts or expressions" and can be used to get, set, or perform simple operations.
  2. In "if" conditions you can omit the double curly braces, as the whole condition is evaluated as an expression: if: contains(github.ref, 'tags/v')
  3. You can set variables for the whole workflow to use in "env"
  4. Reading those variables is done with the env context when you are inside a with, name, or if: ${{ env.SOME_VARIABLE }}
  5. Inside of run, you have access to bash ENV variables in addition to contexts/expressions. That means $SOME_VARIABLE or ${SOME_VARIABLE} will work but only when using bash and not while using powershell on windows. The version with curly braces (variable expansion) is often used when the variable is forming part of a larger string to avoid ambiguity. Be sure that the ENV variable was set properly in the workflow/job/step before you use it. And if you need the variable to be os-agnostic, use the env context.

What's up with the SharedCode interface target, is it needed?

If you want to build both plugin targets and a test target, unfortunately the additional abstraction of the INTERFACE SharedCode target is needed (as of Nov 2023). If you aren't running tests, shame on you, but hey, you can simply edit the CMake and get rid of it :)

The summary: JUCE modules build separately for each target. You need to link against them with PRIVATE visibility. But both JUCE's internal plugin shared code target (which powers the formats like AU, VST, etc) and Pamplejuce's Tests target need to link against the same JUCE modules.

This becomes a problem when you link Tests to YourPlugin target, as it causes ODL issues and confuses your IDE. Additionally, it is hard/impossible to set different compile definitions for the Tests target vs. plugin targets (for example, you'll probably need to enable the deprecated modal loops, guard macros for running tests, etc).

I spoke with Reuben at JUCE a bit about this here and there's a Pamplejuce issue with background here.

What if I need to include files not in modules and not in /source?

If you have control over the files, I highly recommend taking 3 minutes to make a JUCE module — if nothing else than to wrap the code you need and make the build system nice and easy. See the module API, or other JUCE modules for an example on how to do it.

If that's not an option, you could add more directories in the file(GLOB_RECURSE SourceFiles line in the CMakeLists.txt and maybe fiddle with source_group to have things show up in your IDE. But again, I recommend sticking with JUCE modules and keeping the IDE source tree reflective of your filesystem.

How do I build JuceHeader.h

Using JuceHeader.h has been deprecated for some time — if it's a new project, definitely avoid it!

Instead, directly include the .h files you need from the juce modules you are using, like #include "juce_gui_basics/juce_gui_basics.h"

If you are converting an older project, it's still worth the conversion away from JuceHeader.h to using the actual juce modules you need. You'll get faster compilation, autocomplete, etc. You can see an example of the conversion I did for the pluginval project. It's less scary than you think: just make sure the juce:: prefix is added everywhere, try to compile and your IDE will yell at you when you need to include one of the modules :)

Contributing

Thanks to everyone who has contacted me over discord DM and/or contributed to the repository.

This repository covers a lot of ground. JUCE itself has a lot of surface area. It's a group effort to maintain the garden and keep things nice!

If something isn't just working out of the box — it's not just you — others are running into the problem, too, I promise. Please submit a PR or issue.

Original References & Inspiration

CMake

GitHub Actions

Catch2 & CTest

Packaging, Code Signing and Notarization

pamplejuce's People

Contributors

bboettcher3 avatar calgoheen avatar cthom055 avatar danra avatar dependabot[bot] avatar josediazrohena avatar madskjeldgaard avatar mikelange49 avatar n0ner avatar olbotta avatar satelllte avatar sudara avatar zsliu98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pamplejuce's Issues

Update Deprecated MacOs Actions

Running github actions shows the following warnings for MacOs

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: apple-actions/import-codesign-certs@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
This needs to be resolved by around September, 2023

The set-output command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
This needs to be resolved by 1 June, 2023.

Running GitHub Actions without MacOS/Windows Certs

I'd like to use the GitHub actions pipeline to build the plugin for VST/AU, and generate installers as well if possible. However I don't yet have the MacOS or Windows certificates that are used in the GitHub actions script. Do you recommend an approach for this situation, before the certificates have been obtained?

Thank you!

Make Major versioning default

Breaking changes (big parameter changes in particular) should result in a new major release of a plugin.

We want to setup this behavior as a default by default always post-fixing the major version onto both the PROJECT_NAME and JUCE's PRODUCT_NAME.

Windows installer does not work

pamplejuce installer runs fine, but does not install a .vst3 to the desired location. Rather, it installs two files: unins000.dat and unins000. I first noticed this when checking the installer for my project, which is build from the pamplejuce template. The issue occurs here as well.

Add example module

I'm thinking of adding the inspector by default.

It could also just be commented out in CMake, making it really easy to uncomment to add.

A main benefit is to show new CMake users an example of how modules should be setup.

Can a plugin depend on this repo?

The 🐘 in this repo is:

You still need to copy and paste all this stuff into your_new_plugin.git and modify things to taste.

This precludes pulling in updates down the line from pamplejuce, which might be the antithesis of "best practice" (see: manual copy/paste).

Ideas:

  1. Break all the github action "meat" out into its own official github action. This could be nice.
  2. Provide a .cmake script to include as a submodule
  3. Be at peace with providing an example (vs. a framework). Accept the fact that the CMake config will be copy and paste spaghetti, slightly different for each plugin.

installer.iss & deprecated macOS actions

  1. line 24 of installer.iss
Source: "..\Builds\Pamplejuce_artefacts\Release\VST3\{#PluginName}.vst3\*"; DestDir: "{commoncf64}\VST3\{#PluginName}.vst3\"; Excludes: *.ilk; Flags: ignoreversion recursesubdirs;

For me, changing Pamplejuce_artefacts to {#PluginName}_artefacts looks better:

Source: "..\Builds\{#PluginName}_artefacts\Release\VST3\{#PluginName}.vst3\*"; DestDir: "{commoncf64}\VST3\{#PluginName}.vst3\"; Excludes: *.ilk; Flags: ignoreversion recursesubdirs;
  1. as mentioned in #19 , current GitHub actions will show the following warnings:
[macOS](https://github.com/zsliu98/RCInflator/actions/runs/4782510177/jobs/8501911356)
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: apple-actions/import-codesign-certs@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
[macOS](https://github.com/zsliu98/RCInflator/actions/runs/4782510177/jobs/8501911356#step:12:21)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
[macOS](https://github.com/zsliu98/RCInflator/actions/runs/4782510177/jobs/8501911356#step:12:60)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
[Windows](https://github.com/zsliu98/RCInflator/actions/runs/4782510177/jobs/8501911420#step:48:29)
Saving cache failed: Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

It seems that if I use apple-actions/import-codesign-certs@v2 instead of apple-actions/import-codesign-certs@v1 the warnings related to macOS will disappear, see actions. However, since macOS notarization is disabled in my actions, I am not sure whether it will work for that.

Artifact names wrong

The upload-artifact steps have name: ${{ env.PRODUCT_NAME }}.zip etc.

But the action-gh-release step fails to find them, because it has ${{ env.PROJECT_NAME }}-Linux.zip/* (PROJECT vs PRODUCT.)

Personally I prefer PRODUCT, since it puts the version number in the filename. Something like ${{ env.PROJECT_NAME }}-*-Linux.zip/* seems to work.

Command PhaseScriptExecution failed with a nonzero exit code

I am getting the error below when building Tests. I saw the same thing when compiling Catch2 v3 tests for a simple Hello World program on the same system (macOS 12.5, Xcode 13.4.1) and wondered how you had solved it. This does not happen on an older system (intel process, macOS 11.x).

CMake Error at _deps/catch2-src/extras/CatchAddTests.cmake:60 (message):
  Error running test executable
  '/Users/home/Documents/SourceControl/test-pample/Builds/Debug/Tests':

    Result: Subprocess killed
    Output: 


Command PhaseScriptExecution failed with a nonzero exit code

cmake_ctest.yml : fails to clone private submodule

Hi

I'm trying to add a submodule from a private repo.
This submodule, as well as my pamplejuce project, are in a github organization.

cmake_ctest.yml action fails on cloning that repo :
remote: Repository not found.

For now I'm trying to fix it using webfactory/ssh-agent
If I succeed, I'll post here.

Meanwhile, if anyone has already done it, please share.

Request: add a `MessageManager` fixture for testing plugins that need it.

AudioProcessor implementations may have a dependency on juce::MessageManager. As far as I can tell, the message manager is instantiated by the plugin editor, which we don't create (or want to create) when running tests. As such, testing a plugin that needs a message manager for the processor, such as when juce::AudioParameterValueTreeState is used to manage parameters, results in an assert.

This issue can be trivially resolved by getting a pointer to the message manager via it's static accessor before APVTS needs it—that's not every nice.

It would be great to have an fixture that, when added to the processor (probably behind some kind of #if TEST macro), will ensure that this message manager is properly instantiated and de instantiated

Best practice to add a bunch of assets from dropbox for inclusion in binary content?

Hi, Im using this template and Ive come to a point where theres a bunch of content in DropBox that I have to include so that they becomre binary assets from juce. The question whats the best way for inclusion?

The best Ive come up with so far is just a bunch of File(DOWNLOAD steps to place the files in "${CMAKE_BINARY_DIR}/assets/" and then add this path to the existing assets script:

file(GLOB_RECURSE AssetFiles CONFIGURE_DEPENDS 
    "${CMAKE_CURRENT_SOURCE_DIR}/assets/*"
    "${CMAKE_BINARY_DIR}/assets/*")

I was curious if this was something you had come across and potentially had a better solution?

Thanks!
Dave.

Support for alpha and beta versioning

Context: https://forum.juce.com/t/how-do-you-handle-plugin-versioning/57673

Plugin companies are in a unique spot where

  1. Changes to parameters, etc completely break existing user projects
  2. Alphas, betas and major versions all tend to do this
  3. There's not much consensus/hygiene from plugin companies or trust from users around this
  4. There's no tooling or convention for this

Requirements:

  • Be able to select Alpha, Beta, Released
  • Major versions show up as different plugins in the DAW
  • Project name has to change (to prevent build confusion/contamination when switching versions): set(PROJECT_NAME "MyPlugin_v${MAJOR_VERSION}")
  • Major version only appends to PRODUCT_NAME where relevant. So NOT on 0.0.1 or 1.0 but on a1, a2, a3, b1, b2, b3, v2, v3: PRODUCT_NAME "My Plugin v${MAJOR_VERSION}"
  • Convention for PLUGIN_MANUFACTURER_CODE

Example PLUGIN_MANUFACTURER_CODE:

Two digits reserver for major version numbers support

SM10 Mela  -  Melatonin: Sine Machine v10
SM11 Mela  -  Melatonin: Sine Machine v11 
SM12 Mela  -  Melatonin: Sine Machine v12 
SM13 Mela  -  Melatonin: Sine Machine v13 

One digit available for major versions, Alpha and Beta specified with A or B

TP3X GDHZ  -  Goodhertz: Ghz Tupe 3    
TPB1 GDHZ  -  Goodhertz: Ghz Tupe 3 B1 
TPB2 GDHZ  -  Goodhertz: Ghz Tupe 3 B2 

GH workflow error: `fatal error: 'curl/curl.h' file not found`

Hi! When building a plugin with JUCE_USE_CURL=1 and NEEDS_CURL TRUE, I run into the following error when building for Linux in GH actions:

/home/runner/work/tensorjuce-wave-to-wave/tensorjuce-wave-to-wave/JUCE/modules/juce_core/juce_core.cpp:92:13: fatal error: 'curl/curl.h' file not found
   #include <curl/curl.h>

Any help would be appreciated! Thanks :)

Replace DMG with packages and productbuild

Finally it's time!

The hard part here is making the xml. It should reuse as much info as possible from CMake. Could also look into CMake doing signing and packaging, but I'm scared :)

Latest MacOS/Windows installers not working (v0.0.1)

I downloaded the latest installers from the Pamplejuce releases page and ran the Windows and Mac installers. Neither installer is working, for different reasons. Here are more details (I tested this using Ableton Live 11 on both OS):

Windows 10 Pro (VST3)

Ran the installer and used the default location (C:\Program Files\Common Files\VST3\). Inside that folder, it only added 2 files: unins000.dat, and unins000.exe. No Pamplejuce.vst3 file can be found.

After rescanning for new plugins, Ableton does not show any Pamplejuce plugin in the Plug-Ins list (other VST3 plugins in the folder are showing up). This is expected as the installer did not seem to install any VST3 files, just the 2 files mentioned above.

macOS 10.13.6 (VST3/AU)

VST3

Ran the installer and Pamplejuce.vst3 was installed to folder Library/Audio/Plug-ins/VST3/. However, after scanning the folder for new plugins with Ableton 11, it does not show up in the list of available Plugins. I repeated this with the JUCE AudioPluginHost application, and it does not recognize Pamplejuce.vst3 when scanning the folder containing it.

AU

Pamplejuce.component was installed to Library/Audio/Plug-ins/Components/. Ableton does recognize it, so it shows up in AU Plugins list. However, when adding it to an audio track, this error message is displayed:

"Failed to create the Audio Unit "Pamplejuce." This Audio Unit plug-in could not be opened."

Hope this helps. Any thoughts appreciated!

Refactor some of the hairier cmake stuff into includes

Ideally the main CMake is user friendly and hides some of the complex stuff behind includes.

That way people can also decide not to include stuff they don't care about (IPP, Xcode, etc)

Also means I can more aggressively comment on the strange stuff without clogging up readability.

Provide clarity on the best-practices for the cmake/ submodule

Hi Sudara,

Could you clarify something - currently pamplejuce has the cmake/ submodule, which is wired up for a project named "PampleJuce" - is it correct that the files in this submodule should be refactored to use the name of the target project, instead?

For example, I'm setting up PolarDesigner.pamplejuce to build our plugins - so I'm refactoring all PampleJuce->PolarDesigner references I can find. This kind of breaks with cmake/ as a submodule.

Could you add some docs to clarify this? Either:

a) the end-developer should clone the cmake submodule for their project and refactor it as needed, or
b) cmake/ doesn't really need to be a submodule for the purposes of altering a PampleJuce template for the target project.

Make sense?

Is linking juce modules with PUBLIC visibility dangerous?

I just fell over this:

Due to the way that INTERFACE libraries work in CMake, linking to a module added in this way must be done using PRIVATE visibility. Using PUBLIC will cause the module sources to be added both to the target's SOURCES and INTERFACE_SOURCES, which may result in many copies of the module being built into a single target, which would cause build failures in the best case and silent ODR violations in the worst case. Scary stuff!

So might be a bit dangerous to go

target_link_libraries("${PROJECT_NAME}"
    PRIVATE
    Assets
    PUBLIC
    juce::juce_audio_utils
    juce::juce_audio_processors
    juce::juce_recommended_config_flags
    juce::juce_recommended_lto_flags
    juce::juce_recommended_warning_flags)

Or what? Changing to PRIVATE of course breaks the test target further down. Was just wondering if you were aware of this and what your thoughts are, @sudara? :)

[cmake] Version can not be used in CMakeLists.txt

Bug description

The version information contained in VERSION can not be handled by CMake. If you use the most recent CMakeLists.txt on the codesign branch I get the following error:

CMake Error at CMakeLists.txt:25 (project):
  VERSION "0.2.1

  " format invalid.

I tried to add string quotes here and there but to no avail.

To reproduce

Steps to reproduce the behavior:

  1. Run CMake configuration via e.g. cmake . -B build-debug -G "Unix Makefiles"

Platform

I tested this on my laptop using Ubuntu 20.04, kernel 5.4.0-122-generic. I don't know whether the problem is reproducible on other platforms.

Possible fix

This easy fix worked for me:

# fails
file(READ VERSION CURRENT_VERSION)
# works
file(STRINGS VERSION CURRENT_VERSION)

However, someone would need to try and reproduce the fix on Windows and MacOS.

Please add a license file

Hello! Thanks for the great work here - we'd love to start creating plugins using this template you've created.

However, as there is no license file:
"If there’s no license, it means that the code is “All rights reserved” by default. This is really bad because it means that everyone who uses this template to start their own project are doing it illegaly and breaking your copyright. Being the code on GitHub allows everyone to look at it (as per the GitHub’s Terms of Service), but it doesn’t give anyone rights to use the code or fork it."

Improving Releases, tags and handling of the VERSION file

When I want to release a new version, I have to:

  • update the VERSION file
  • git add & commit
  • git tag & git push --tags

If I create the VERSION file from git tags, I can save myself from the first step:

    - name: Get lastest tag
      uses: "WyriHaximus/github-action-get-previous-tag@v1"
      id: get-latest-tag
      with:
        fallback: 0.0.0

    - name: Setup Environment Variables
      shell: bash
      run: |
        echo "${{steps.get-latest-tag.outputs.tag}}" > VERSION
        VERSION=$(cat VERSION)
# ......

However in this case I have to make sure that the tags are in the format "-.-.-" What do you think about this?

See this workflow as an example.

MacOS deployment target issue

Thanks for this template -- it's very helpful.

When I ran the Standalone app on Mac OS 10.14.6., I got the error: You have macOS %@. The application requires macOS %@ or later. Not sure what's up with the version string there. But adding this to the top of CMakeLists.txt fixed it:

set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version")

[Bug?] DMG will not let you copy on MacOS 14.1.1

After opening the downloaded dmg (from release 0.0.1), Dragging the vst3 (or component) over the proper folder results in the icon snapping back to the original position without doing anything.

After using xattr to remove the quarantine attribute it works fine.

Using codesign I can see that the dmg is signed, notarized, and stapled.

M2 using MacOS 14.1.1

Request: add 'includes' file structure to template

I spent a lot of time wracking my brain trying to sort how to build my project with source files outside of ~/repo_root/source. It's actually not very hard at all.

It would be nice to have something in the template making this more obvious. This could be as simple as a dummy class living in a ~/repo_root/libs/common folder that is referenced in the audio processor header and making the necessary changes to CMakeLists.txt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.