2024-02-21 22:44:10 +01:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}"
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
|
|
|
|
)
|
2023-05-08 14:43:33 +02:00
|
|
|
if(SFIZZ_USE_SYSTEM_VST3SDK)
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
pkg_check_modules(VST3SDK "vst3sdk" REQUIRED)
|
|
|
|
|
set(VST3SDK_BASEDIR "${VST3SDK_INCLUDE_DIRS}")
|
|
|
|
|
else()
|
|
|
|
|
set(VST3SDK_BASEDIR "${CMAKE_CURRENT_SOURCE_DIR}/external/VST_SDK/VST3_SDK")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# VST plugin specific settings
|
|
|
|
|
include(VSTConfig)
|
|
|
|
|
|
|
|
|
|
configure_file(VstPluginDefs.h.in "${CMAKE_CURRENT_BINARY_DIR}/VstPluginDefs.h")
|
|
|
|
|
|
|
|
|
|
# Build VST3 SDK
|
2024-02-21 22:44:10 +01:00
|
|
|
include(VST3SDK)
|
2023-05-08 14:43:33 +02:00
|
|
|
|
|
|
|
|
# Add the ring buffer
|
2024-01-10 14:42:31 +01:00
|
|
|
set(RINGBUFFER_SOURCES
|
2023-05-08 14:43:33 +02:00
|
|
|
"external/ring_buffer/ring_buffer/ring_buffer.h"
|
2024-01-10 14:42:31 +01:00
|
|
|
"external/ring_buffer/ring_buffer/ring_buffer.tcc"
|
2023-05-08 14:43:33 +02:00
|
|
|
"external/ring_buffer/ring_buffer/ring_buffer.cpp"
|
2024-01-10 14:42:31 +01:00
|
|
|
)
|
|
|
|
|
if(SFIZZ_CMAKE_USE_EMPTY_SOURCE_GROUPS)
|
|
|
|
|
source_group("" FILES ${RINGBUFFER_SOURCES})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(plugins_ring_buffer STATIC EXCLUDE_FROM_ALL ${RINGBUFFER_SOURCES})
|
|
|
|
|
target_include_directories(plugins_ring_buffer PUBLIC "external/ring_buffer")
|
|
|
|
|
add_library(plugins::ring-buffer ALIAS plugins_ring_buffer)
|
2023-05-08 14:43:33 +02:00
|
|
|
|
|
|
|
|
# Build the VST shared code
|
2024-01-10 14:42:31 +01:00
|
|
|
set(VST3_CORE_SOURCES
|
2023-05-08 14:43:33 +02:00
|
|
|
SfizzVstProcessor.cpp
|
|
|
|
|
SfizzVstProcessor.h
|
|
|
|
|
SfizzVstController.cpp
|
|
|
|
|
SfizzVstController.h
|
|
|
|
|
SfizzVstEditor.cpp
|
|
|
|
|
SfizzVstEditor.h
|
|
|
|
|
SfizzVstState.cpp
|
|
|
|
|
SfizzVstState.h
|
|
|
|
|
SfizzVstParameters.h
|
|
|
|
|
SfizzVstUpdates.h
|
|
|
|
|
SfizzVstUpdates.hpp
|
|
|
|
|
SfizzVstUpdates.cpp
|
|
|
|
|
SfizzVstIDs.h
|
|
|
|
|
OrderedEventProcessor.h
|
|
|
|
|
OrderedEventProcessor.hpp
|
|
|
|
|
IdleUpdateHandler.h
|
|
|
|
|
X11RunLoop.h
|
2024-01-10 14:42:31 +01:00
|
|
|
X11RunLoop.cpp
|
|
|
|
|
)
|
|
|
|
|
if(SFIZZ_CMAKE_USE_EMPTY_SOURCE_GROUPS)
|
|
|
|
|
source_group("" FILES ${VST3_CORE_SOURCES})
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(plugins_vst3_core STATIC EXCLUDE_FROM_ALL ${VST3_CORE_SOURCES})
|
|
|
|
|
|
|
|
|
|
target_include_directories(plugins_vst3_core PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
target_link_libraries(plugins_vst3_core PRIVATE
|
|
|
|
|
sfizz::sfizz
|
|
|
|
|
sfizz::filesystem
|
|
|
|
|
sfizz::import
|
|
|
|
|
sfizz::pugixml
|
|
|
|
|
plugins::common
|
|
|
|
|
plugins::editor
|
|
|
|
|
plugins::ring-buffer
|
|
|
|
|
absl::strings
|
|
|
|
|
absl::optional
|
|
|
|
|
absl::container_common
|
2023-05-08 14:43:33 +02:00
|
|
|
vst3sdk
|
2024-01-10 14:42:31 +01:00
|
|
|
vst3sdk_vstgui
|
|
|
|
|
)
|
|
|
|
|
gw_target_warn(plugins_vst3_core PRIVATE
|
2023-05-08 14:43:33 +02:00
|
|
|
"-Wno-ignored-qualifiers"
|
|
|
|
|
"-Wno-unused-parameter")
|
2024-01-10 14:42:31 +01:00
|
|
|
add_library(plugins::vst3_core ALIAS plugins_vst3_core)
|
2023-05-08 14:43:33 +02:00
|
|
|
|
|
|
|
|
# --- VST3 plugin --- #
|
2023-05-20 16:21:00 +02:00
|
|
|
if(PLUGIN_VST3)
|
2024-02-21 22:44:10 +01:00
|
|
|
include(VST3Plugin)
|
2023-05-08 14:43:33 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# --- Audio Unit wrapper --- #
|
2023-05-20 16:21:00 +02:00
|
|
|
if(PLUGIN_AU AND NOT APPLE)
|
2023-05-08 14:43:33 +02:00
|
|
|
message(WARNING "Audio Unit is available only for macOS builds")
|
2023-05-20 16:21:00 +02:00
|
|
|
elseif(PLUGIN_AU)
|
2024-02-21 22:44:10 +01:00
|
|
|
include(AU2Plugin)
|
2023-05-08 14:43:33 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# --- VST2 wrapper --- #
|
2023-05-20 16:21:00 +02:00
|
|
|
if(PLUGIN_VST2)
|
2024-02-21 22:44:10 +01:00
|
|
|
include(VST2Plugin)
|
2023-05-08 14:43:33 +02:00
|
|
|
endif()
|