This repository has been archived by the owner on Jul 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
CMakeLists.txt
88 lines (63 loc) · 2.41 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
85
86
87
88
project(obs-vst)
option(ENABLE_VST "Enable building OBS with VST plugin" ON)
if(NOT ENABLE_VST)
message(STATUS "OBS: DISABLED obs-vst")
return()
endif()
option(ENABLE_VST_BUNDLED_HEADERS "Build with Bundled Headers" ON)
mark_as_advanced(ENABLE_VST_BUNDLED_HEADERS)
add_library(obs-vst MODULE)
add_library(OBS::vst ALIAS obs-vst)
find_qt(COMPONENTS Widgets)
set_target_properties(
obs-vst
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
target_include_directories(
obs-vst PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR})
target_sources(
obs-vst
PRIVATE obs-vst.cpp VSTPlugin.cpp EditorWidget.cpp
headers/vst-plugin-callbacks.hpp headers/EditorWidget.h
headers/VSTPlugin.h)
target_link_libraries(obs-vst PRIVATE OBS::libobs Qt::Widgets)
target_include_directories(
obs-vst PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/headers)
target_compile_features(obs-vst PRIVATE cxx_std_17)
if(ENABLE_VST_BUNDLED_HEADERS)
message(STATUS "OBS: - obs-vst uses bundled VST headers")
target_sources(obs-vst PRIVATE vst_header/aeffectx.h)
target_include_directories(obs-vst
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/vst_header)
else()
set(VST_INCLUDE_DIR
""
CACHE PATH
"Path to Steinburg headers (e.g. C:/VST3 SDK/pluginterfaces/vst2.x)"
FORCE)
mark_as_advanced(VST_INCLUDE_DIR)
message(
WARNING
"OBS: 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."
)
target_sources(obs-vst PRIVATE ${VST_INCLUDE_DIR}/aeffectx.h)
endif()
if(OS_MACOS)
find_library(FOUNDATION Foundation)
find_library(COCOA Cocoa)
mark_as_advanced(COCOA FOUNDATION)
target_sources(obs-vst PRIVATE mac/VSTPlugin-osx.mm mac/EditorWidget-osx.mm)
target_link_libraries(obs-vst PRIVATE ${COCOA} ${FOUNDATION})
elseif(OS_WINDOWS)
target_sources(obs-vst PRIVATE win/VSTPlugin-win.cpp win/EditorWidget-win.cpp)
target_compile_definitions(obs-vst PRIVATE UNICODE _UNICODE)
elseif(OS_POSIX)
target_sources(obs-vst PRIVATE linux/VSTPlugin-linux.cpp
linux/EditorWidget-linux.cpp)
endif()
set_target_properties(obs-vst PROPERTIES FOLDER "plugins" PREFIX "")
setup_plugin_target(obs-vst)