CMakeLists.txt (5611B)
1 2 cmake_minimum_required (VERSION 3.25.0) 3 4 # Specify the minimum version of the target platform 5 if(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) 6 set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "macOS deployment target") 7 endif() 8 9 # Global options which can bet set on command line e.g.: cmake -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF ... 10 option(SMTG_ENABLE_VST3_PLUGIN_EXAMPLES "Enable VST 3 Plug-in Examples" ON) 11 option(SMTG_ENABLE_VST3_HOSTING_EXAMPLES "Enable VST 3 Hosting Examples" ON) 12 option(SMTG_ENABLE_VSTGUI_SUPPORT "Enable VSTGUI Support" ON) 13 14 #------------------------------------------------------------------------------- 15 # Includes 16 #------------------------------------------------------------------------------- 17 18 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") 19 20 include(SMTG_VST3_SDK) 21 22 #------------------------------------------------------------------------------- 23 # SDK Project 24 #------------------------------------------------------------------------------- 25 project(vstsdk 26 VERSION 3.7.13 27 DESCRIPTION "Steinberg VST 3 Software Development Kit" 28 HOMEPAGE_URL "https://www.steinberg.net" 29 ) 30 31 smtg_setup_platform_toolset() 32 smtg_setup_symbol_visibility() 33 34 set(ROOT "${CMAKE_CURRENT_SOURCE_DIR}") 35 36 # Set the location of the VST 3 SDK 37 set(SDK_ROOT "${ROOT}") 38 set(public_sdk_SOURCE_DIR ${SDK_ROOT}/public.sdk) 39 set(pluginterfaces_SOURCE_DIR ${SDK_ROOT}/pluginterfaces) 40 41 if(SMTG_ENABLE_VSTGUI_SUPPORT) 42 smtg_enable_vstgui_support(VSTGUI_SOURCE_DIR "${ROOT}/vstgui4") 43 endif() 44 45 include_directories(${ROOT} ${SDK_ROOT}) 46 47 #------------------------------------------------------------------------------- 48 # From Here this is optional... 49 50 #------------------------------------------------------------------------------- 51 # CORE AUDIO SDK, AAX SDK 52 #------------------------------------------------------------------------------- 53 setupCoreAudioSupport() 54 setupAaxSupport() 55 include(SMTG_FindJack) 56 57 #------------------------------------------------------------------------------- 58 # Projects 59 #------------------------------------------------------------------------------- 60 set(SDK_IDE_LIBS_FOLDER FOLDER "Libraries") 61 62 #---Add base libraries--------------------------- 63 set(VST_SDK TRUE) # used for pluginterfaces and public.sdk modules which provides only a subset of them for VST-SDK 64 add_subdirectory(pluginterfaces) 65 add_subdirectory(base) 66 add_subdirectory(public.sdk) 67 add_subdirectory(public.sdk/source/vst/interappaudio) 68 69 #---Add Wrappers (AU, AAX)----------------------- 70 if(NOT "${SMTG_ENABLE_AUV2_BUILDS}" STREQUAL "") 71 add_subdirectory(public.sdk/source/vst/auwrapper) 72 endif() 73 74 if(NOT "${SMTG_AAX_SDK_PATH}" STREQUAL "") 75 add_subdirectory(public.sdk/source/vst/aaxwrapper) 76 set_target_properties(aax_wrapper 77 PROPERTIES 78 ${SDK_IDE_LIBS_FOLDER} 79 ) 80 endif() 81 82 # Add hosting examples, it includes the validator (must be done before any plug-ins to support running the validator after building) 83 set(SDK_IDE_HOSTING_EXAMPLES_FOLDER FOLDER "Hosting-Examples") 84 add_subdirectory(public.sdk/samples/vst-hosting) 85 86 # Add utilities 87 set(SDK_IDE_UTILITIES_FOLDER FOLDER "Utilities") 88 add_subdirectory(public.sdk/samples/vst-utilities) 89 90 #---Add VST 3 examples (plug-ins and hosting)----- 91 if(SMTG_ENABLE_VST3_PLUGIN_EXAMPLES) 92 set(SDK_IDE_PLUGIN_EXAMPLES_FOLDER FOLDER "PlugIn-Examples") 93 add_subdirectory(public.sdk/samples/vst) 94 add_subdirectory(public.sdk/source/vst/auv3wrapper) 95 endif() 96 97 #------------------------------------------------------------------------------- 98 # IDE sorting 99 #------------------------------------------------------------------------------- 100 include(SMTG_CustomModuleTarget) 101 102 set_property( 103 TARGET 104 sdk 105 sdk_common 106 sdk_hosting 107 base 108 pluginterfaces 109 cmake_modules 110 cmake_VST_modules 111 PROPERTY 112 ${SDK_IDE_LIBS_FOLDER} 113 ) 114 115 if(TARGET base_ios) 116 set_property( 117 TARGET 118 base_ios 119 pluginterfaces_ios 120 PROPERTY 121 ${SDK_IDE_LIBS_FOLDER} 122 ) 123 endif() 124 125 if(SMTG_ENABLE_VSTGUI_SUPPORT) 126 set_property( 127 TARGET 128 vstgui 129 vstgui_support 130 vstgui_uidescription 131 PROPERTY 132 ${SDK_IDE_LIBS_FOLDER} 133 ) 134 135 if(TARGET vstgui_standalone) 136 set_target_properties(vstgui_standalone 137 PROPERTIES 138 ${SDK_IDE_LIBS_FOLDER} 139 ) 140 endif() 141 endif() 142 143 #------------------------------------------------------------------------------- 144 # macOS & iOS collection targets 145 #------------------------------------------------------------------------------- 146 option(SMTG_VSTSDK_GENERATE_MACOS_IOS_COLLECTION_TARGETS "Create macOS and iOS collection targets" OFF) 147 148 if(SMTG_VSTSDK_GENERATE_MACOS_IOS_COLLECTION_TARGETS) 149 150 function(get_all_targets var) 151 set(targets) 152 get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR}) 153 set(${var} ${targets} PARENT_SCOPE) 154 endfunction() 155 156 macro(get_all_targets_recursive targets dir) 157 get_property(subdirectories DIRECTORY ${dir} PROPERTY SUBDIRECTORIES) 158 foreach(subdir ${subdirectories}) 159 get_all_targets_recursive(${targets} ${subdir}) 160 endforeach() 161 162 get_property(current_targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS) 163 list(APPEND ${targets} ${current_targets}) 164 endmacro() 165 166 get_all_targets(all_targets) 167 168 add_custom_target(iOS_Targets) 169 add_custom_target(macOS_Targets) 170 171 foreach(target_name ${all_targets}) 172 if(${target_name} MATCHES "ios") 173 add_dependencies(iOS_Targets ${target_name}) 174 else() 175 add_dependencies(macOS_Targets ${target_name}) 176 endif() 177 endforeach() 178 179 endif()