Page tree
Skip to end of metadata
Go to start of metadata

This tutorial explains how to use cmake with VST 3 SDK.

CMake for building VST 3 plug-ins

The SDK provides a set of cmake files allowing you to compile the included samples and to develop new plug-ins.

Command line for Windows

Example for building Microsoft "Visual 2015" solution:

// go in to the folder where you extracted the VST 3 SDK
mkdir build 
cd build 
cmake -G"Visual Studio 15 2017 Win64" "..\VST3_SDK" 

// for Visual 2017: 
cmake -G"Visual Studio 15 2017 Win64" "..\VST3_SDK"
 or for 32bit 
cmake -G"Visual Studio 15 2017" "..\VST3_SDK" 
// note: you can find the string definition for different Visual Studio Generators in the cmake online documentation

Command line for macOS

 Example for building Xcode project:

// go in to the folder where you extracted the VST 3 SDK 
mkdir build 
cd build 
/Applications/CMake.app/Content/bin/cmake -G"Xcode" "../VST3_SDK"

On Linux with QtCreator

You can use QtCreator 2.3.1 (or higher)

start QtCreator 2.3.2
open the CMakeLists.txt located at the top of the VST 3 SDK folder
click on the menu Build->Run CMake

Use of cmake-gui

start the CMake (cmake-gui) application
set "Where is the source code" to the location of the "VST3_SDK" folder
set "Where to build the binaries" to a build folder of your choice
click on "Configure"
click on "Generate" for creating project/solution

Example of cmakegui application on Windows

  • Compile with cmake command line
cd build
cmake --build 
  • Choose a specific compiler with cmake (command line on Linux)
cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++

or

cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++

Available SMTG cmake options

  • SMTG_ADD_VST3_HOSTING_SAMPLES : Add VST3 hosting samples to the solution (default ON)
  • SMTG_ADD_VST3_PLUGINS_SAMPLES : Add VST3 plug-in samples to the project (default ON)
  • SMTG_ADD_VSTGUI : Add VSTGUI support (default ON)
  • SMTG_BUILD_UNIVERSAL_BINARY : Build universal binary (32 & 64 bit) (Mac only)
  • SMTG_CREATE_BUNDLE_FOR_WINDOWS: Create bundle on Windows for the VST3 plug-ins (new since 3.6.10! Windows only) (default ON)
  • SMTG_CREATE_PLUGIN_LINK : Create symbolic link for each VST3 plug-in in ${VST3_FOLDER_NAME} folder (you need to have Administrator rights on Windows or change the Local Group Policy to allow the creation of symbolic links)
  • SMTG_CREATE_VST2_AGAIN_SAMPLE_VERSION : Allows you to create the VST2 version of the Sample Plug-in AGain, be sure that you have copied the VST2 interfaces into the folder VST_SDK/VST3_SDK/pluginterfaces/vst2.x (default OFF)
  • SMTG_ENABLE_TARGET_VARS_LOG : Enables to log target variables for debugging (new since 3.6.11!) (default OFF)
  • SMTG_ENABLE_USE_OF_JACK : Allows you to create the audiohost application using Jack (default OFF)
  • SMTG_MDA_VST3_VST2_COMPATIBLE : Build the MDA examples as a replacement for their VST2 counterpart (default ON) SMTG_IOS_DEVELOPMENT_TEAM : Needed for building the InterAppAudio and AUv3 examples for iOS (Mac only)
  • SMTG_MYPLUGINS_SRC_PATH : Here you can add your VST3 plug-ins folder
  • SMTG_PACKAGE_ICON_PATH : Path to the package icon (VST_Logo_Steinberg.ico) for Windows (Windows only)
  • SMTG_PLUGIN_TARGET_PATH : Here you can redefine the VST3 plug-ins folder
  • SMTG_RENAME_ASSERT : Rename ASSERT to SMTG_ASSERT to avoid conflicts with 3rd party libraries (default ON)
  • SMTG_RUN_VST_VALIDATOR : Run the VST validator on VST3 plug-ins each time they are built (default ON)
  • SMTG_USE_STATIC_CRT : Use static CRuntime on Windows (option /MT) (default OFF) (Windows only)

Some other variables:

  • SMTG_AAX_SDK_PATH : Here you can define where the AAX SDK is located (if needed)
  • SMTG_COREAUDIO_SDK_PATH : Here you can define where the COREAUDIO SDK is located (Mac only, if needed)


Note for Windows: In order to be able to create a symbolic link, you have to set the correct group policy. Proceed as follows:

Run gpedit.msc

Navigate to:

Computer Configuration => Windows Settings => Security Settings =>Local Policies => User Rights Assignment => Create symbolic links

Here you can set which users can create symbolic links.

Using your IDE for compiling the examples

  • solution/project (vstsdk.sln/vstsdk.xcodeproj) is generated in the "build" folder.
  • the created plug-ins are located in the "build" folder, in sub-folders /VST3/Release or /VST3/Debug.
  • In order to allow a DAW to find these plug-ins you have to create links from the official VST3 Locations to them.


  • No labels