New source files go in /source
.
All .h
and .cpp
files in that directory will be available to include in your plugin targets and your test/benchmarks target.
Tests go in /tests
. Add .cpp
files there and they will be available in the Tests target.
IDE FILE MANAGEMENT
If you use an overeager, CMake-aware IDE (like CLion) it might prompt you to add files to a CMake target. Don’t do this, all files in /source
are already automagically added.
Working with PluginProcessor and PluginEditor
In general I recommend not stuffing all of your code into the boilerplate PluginEditor/PluginProcessor files. Instead, organize your code into files that those files include:
Reasoning:
- If you ever need to debug complex CMake build issues, you’ll appreciate being able to start anew from a fresh starting place with all the working defaults.
- When you build another product, you won’t have to fish around in those files trying to find all your logic.
- It’s 2024, but C++ hygiene is still somewhat… lacking. There’s 0 excuse to have a thousand line plugin editor full of spaghetti code, it’ll just make your development life harder.
Sure, go ahead make a mess at first! But then clean them up as you go, you won’t regret it.
Leave a Reply