Visual Studio Code + CMake based cross-platform template for developing a REAPER Plug-in Extension
A template for REAPER Plug-in Extension development using Visual Studio Code and CMake with presets. Developed and tested on Windows, macOS, and Linux.
Install Visual Studio with at least these components:
- C++ CMake tools for Windows
- Windows 10/11 SDK
Install Homebrew (also installs Xcode Command Line Tools), then:
brew install cmake git gersemisudo apt install build-essential cmake gdb git ninja-build-
Install Visual Studio Code and Git.
-
Clone this repository:
git clone https://github.com/your-username/your-plugin.git cd your-plugin -
Install the CMake Tools extension:
code --install-extension ms-vscode.cmake-tools
-
Open the workspace:
code . -
CMake Tools will detect
CMakePresets.jsonand prompt to select a configure preset - choose the one matching your platform and toolchain (e.g. Windows MSVC x64 Debug). -
Dependencies (WDL, reaper-sdk) are fetched automatically by CMake on first configure.
- Project configuration
- Source code
- Build with
CMake: BuildorF7. The plugin is installed to your REAPERUserPluginsfolder automatically after each build. - Start REAPER - the action (
MyUsername: MyPlugin) should be available in the Action List (?). - Triggering the action should print
hello, worldto the REAPER console. - Switch between Debug and Release by changing the active configure preset (
CMake: Select Configure Presetfrom the Command Palette or the Status Bar). - Debug with
F5. On first launch, editlaunch.jsonand set"program"to your REAPER executable path, e.g."C:/Program Files/REAPER (x64)/reaper.exe". - VSCode C++ docs, Microsoft C++ docs, and the REAPER Developer Forum are useful resources.
- CMake presets: configure/build presets for Windows, macOS, and Linux
- Dependency fetching: WDL and reaper-sdk are fetched with
FetchContentduring configure - Version and build metadata:
prepare.cmakereads version from git tags and records commit/branch inconfig.h - Install step for REAPER: build output is copied to REAPER
UserPluginsafter build - Tests: unit tests use GoogleTest with CTest
- Benchmarks: Google Benchmark target with JSON output for CI artifact upload and performance tracking over time
- Packaging: CPack config for
.exe(Windows),.pkg(macOS), and.deb(Linux) installers - CI workflows: GitHub Actions build matrix, tests, and formatting checks (clang-format, gersemi)
- Release workflow:
release.ymlcreates version tags with semantic-release and uploads draft release artifacts - Formatting:
.clang-formatconfig and CI checks - Static analysis:
.clang-tidyconfig with CMake integration - Git hook:
.githooks/pre-commitrunsclang-formatandgersemiformatting checks before commits - Dependency updates: Dependabot updates GitHub Actions dependencies
- Signing/notarization: macOS and Windows code signing and notarization with CPack packaging and GitHub Actions
- Reusable project template: REAPER-specific logic is isolated and can be removed for non-REAPER targets; in toplevel
CMakeLists.txtchange project name, replace source files insrc/with our own, removeinclude(cmake/reaper-plugin.cmake), swap toadd_executable(${PROJECT_NAME}), and start working on your own project!
