forked from obsproject/obs-vst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
84 lines (67 loc) · 1.9 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
if(DISABLE_UI)
message(STATUS "UI disabled,so vst plugin disabled")
return()
endif()
if(DISABLE_VST)
message(STATUS "obs-vst is disabled")
return()
endif()
project(obs-vst)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_AUTOMOC TRUE)
find_package(Qt5Widgets REQUIRED)
option(VST_USE_BUNDLED_HEADERS "Build with Bundled Headers" ON)
if(VST_USE_BUNDLED_HEADERS)
message(STATUS "Using the bundled VST header.")
include_directories(vst_header)
set(vst_HEADER
vst_header/aeffectx.h)
else()
set(VST_INCLUDE_DIR "" CACHE PATH
"Path to Steinburg headers (e.g. C:/VST3 SDK/pluginterfaces/vst2.x)")
message(WARNING "You should only use the Steinburg headers for debugging or local
builds. It is illegal to distribute the Steinburg headers with anything, and
possibly against the GPL to distribute the binaries from the resultant compile.")
include_directories(${VST_INCLUDE_DIR})
set(vst_HEADER
${VST_INCLUDE_DIR}/aeffectx.h)
endif()
if(APPLE)
find_library(FOUNDATION_FRAMEWORK Foundation)
find_library(COCOA_FRAMEWORK Cocoa)
endif(APPLE)
set(obs-vst_SOURCES
obs-vst.cpp
VSTPlugin.cpp
EditorWidget.cpp)
if(APPLE)
list(APPEND obs-vst_SOURCES
mac/VSTPlugin-osx.mm
mac/EditorWidget-osx.mm)
elseif(WIN32)
list(APPEND obs-vst_SOURCES
win/VSTPlugin-win.cpp
win/EditorWidget-win.cpp)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
list (APPEND obs-vst_SOURCES
linux/VSTPlugin-linux.cpp
linux/EditorWidget-linux.cpp)
endif()
list(APPEND obs-vst_HEADERS
headers/vst-plugin-callbacks.hpp
headers/EditorWidget.h
headers/VSTPlugin.h)
add_library(obs-vst MODULE
${obs-vst_SOURCES}
${obs-vst_HEADERS}
${vst-HEADER})
target_link_libraries(obs-vst
libobs
Qt5::Widgets)
set_target_properties(obs-vst PROPERTIES FOLDER "plugins")
if(APPLE)
target_link_libraries(obs-vst
${COCOA_FRAMEWORK}
${FOUNDATION_FRAMEWORK})
endif(APPLE)
install_obs_plugin_with_data(obs-vst data)