Summary
Highlights
The video introduces the use of JUCE C++ framework for audio plugin development and highlights the limitations of the JUCE Producer. It then proposes a better alternative using CMake, a cross-platform tool for generating C++ projects, and CPM (CMake Package Manager) for easier integration of third-party libraries like JUCE and Google Test.
The tutorial begins by showing how to create a basic `CMakeLists.txt` file, specifying the minimum required CMake version and defining the project name. It also emphasizes setting the C++ standard to C++23 for Greenfield projects and configuring compiler warning options to treat all warnings as errors for robust code.
This section demonstrates how to integrate CPM (CMake Package Manager) into the project to manage dependencies. It shows how to download and include the CPM script, and then use the `CPMAddPackage` command to fetch the JUCE framework from its GitHub repository, ensuring all third-party libraries are stored locally within the project's `Libs` folder.
The video guides through creating the directory structure for the plugin, including `plugin`, `include`, and `source` folders. It then populates these folders with JUCE's plugin template files, specifically `PluginProcessor.h`, `PluginEditor.h`, `PluginProcessor.cpp`, and `PluginEditor.cpp`.
This part details how to use JUCE's custom CMake commands, specifically `juce_add_plugin`, to configure the audio plugin. It covers setting various parameters like company name, synth status, MIDI input/output, manufacturer code, plugin code, desired formats (VST3), and product name. It also addresses and resolves initial build errors related to linking libraries and warning flags by adding JUCE's recommended configurations.
The tutorial introduces how to add unit tests to the project using Google Test. It explains how to add Google Test as a dependency using CPM, create a `test` folder with its own `CMakeLists.txt` and test source file, and then link the test executable against the main audio plugin and Google Test libraries. It resolves include path issues and confirms the test setup by verifying a failing test.
The video concludes by highlighting the flexibility gained with CMake and CPM, such as seamless integration with Visual Studio, Visual Studio Code, and the potential for GitHub Actions for continuous integration. It also suggests further improvements like using namespaces, git hooks for formatting with `pre-commit`, and caching dependencies in CI/CD pipelines. The presenter also mentions an alternative template (Pamplejuce) but prefers the demonstrated CPM approach for its clarity and version control.