The tutorial “Switching to another VSTGUI submodule or branch” suggests a rather harsh method in order to use a different VSTGUI with the VST3 SDK.
I would suggest a different approach which is much simpler to configure and very simple to implement on your side: let the user specifies where vstgui is located.
You see in the main CMakeLists.txt, there is this entry:
if(SMTG_ADD_VSTGUI)
smtg_enable_vstgui_support(VSTGUI_SOURCE_DIR "${ROOT}/vstgui4")
endif(SMTG_ADD_VSTGUI)
What I am proposing instead, is to simply replace it with:
if(SMTG_ADD_VSTGUI)
set(SMTG_VSTGUI_PATH "${ROOT}/vstgui4" CACHE PATH "Location of VSTGUI")
smtg_enable_vstgui_support(VSTGUI_SOURCE_DIR "${SMTG_VSTGUI_PATH}")
endif(SMTG_ADD_VSTGUI)
This way if the user doesn’t do anything, the VSTGUI that comes with the sdk is used. But if the user wants to checkout (for example using cmake FetchContent
) a different version of vstgui, it is very easy to override:
# simply set the SMTG_VSTGUI_PATH prior to including the vst3sdk
set(SMTG_VSTGUI_PATH "/path/to/vstgui4_different_version" CACHE PATH "Location of VSTGUI")
set(vst3sdk_SOURCE_DIR /path/to/vst3sdk)
add_subdirectory(${vst3sdk_SOURCE_DIR} ${PROJECT_BINARY_DIR}/vst3sdk)