forked from Alzy/obs-midi
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
149 lines (120 loc) · 3.75 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
cmake_minimum_required(VERSION 3.16)
# Change obs-plugintemplate to your plugin's name in a machine-readable format
# (e.g.: obs-myawesomeplugin) and set
project(obs-midi VERSION 0.9.0)
add_library(${CMAKE_PROJECT_NAME} MODULE)
# Replace `Your Name Here` with the name (yours or your organization's) you want
# to see as the author of the plugin (in the plugin's metadata itself and in the installers)
set(PLUGIN_AUTHOR "Chris Yarger <[email protected]>")
# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases
# (used both in the installer and when submitting the installer for notarization)
set(MACOS_BUNDLEID "com.example.obs-midi")
# Replace `[email protected]` with the maintainer email address you want to put in Linux packages
set(LINUX_MAINTAINER_EMAIL "[email protected]")
# Add your custom source files here - header files are optional and only required for visibility
# e.g. in Xcode or Visual Studio
add_subdirectory(src/libremidi)
include_directories(src/libremidi)
target_sources(${CMAKE_PROJECT_NAME}
PRIVATE
src/utils.cpp
src/config.cpp
src/midi-agent.cpp
src/device-manager.cpp
src/obs-controller.cpp
src/forms/settings-dialog.cpp
src/obs-midi.cpp
src/events.cpp
src/rpc/RpcEvent.cpp
src/forms/Macros.cpp
src/Midi_hook.cpp
src/Midi_message.cpp)
target_sources(${CMAKE_PROJECT_NAME}
PRIVATE
src/utils.h
src/config.h
src/midi-agent.h
src/device-manager.h
src/obs-controller.h
src/forms/settings-dialog.h
src/obs-midi.h
src/events.h
src/rpc/RpcEvent.h
src/forms/Macros.h
src/macro-helpers.h
src/Midi_hook.h
src/Midi_message.h)
# /!\ TAKE NOTE: No need to edit things past this point /!\
find_package(libobs REQUIRED)
find_package(obs-frontend-api REQUIRED)
include(external/ObsPluginHelpers.cmake)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
# --- Platform-independent build settings ---
target_include_directories(${CMAKE_PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(${CMAKE_PROJECT_NAME}
PRIVATE
libremidi
OBS::libobs
OBS::obs-frontend-api
Qt5::Core
Qt5::Widgets)
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
target_compile_features(${CMAKE_PROJECT_NAME}
PRIVATE
cxx_std_17)
# --- End of section ---
# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
configure_file(
installer/installer-Windows.iss.in
${CMAKE_SOURCE_DIR}/installer/installer-Windows.generated.iss)
configure_file(
CI/include/build_environment.ps1.in
${CMAKE_SOURCE_DIR}/CI/include/build_environment.ps1)
if(MSVC)
target_compile_options(${CMAKE_PROJECT_NAME}
PRIVATE
/MP
/d2FH4-)
endif()
# --- End of section ---
# -- macOS specific build settings and tasks --
elseif(OS_MACOS)
configure_file(
bundle/installer-macOS.pkgproj.in
${CMAKE_SOURCE_DIR}/bundle/installer-macOS.generated.pkgproj)
configure_file(
CI/include/build_environment.sh.in
${CMAKE_SOURCE_DIR}/CI/include/build_environment.sh
)
set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")
target_compile_options(${CMAKE_PROJECT_NAME}
PRIVATE
-Wall
-Wextra
-Werror-implicit-function-declaration
-stdlib=libc++
-fvisibility=default)
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "")
# --- End of section ---
# --- Linux-specific build settings and tasks ---
else()
configure_file(
CI/include/build_environment.sh.in
${CMAKE_SOURCE_DIR}/CI/include/build_environment.sh
)
target_compile_options(${CMAKE_PROJECT_NAME}
PRIVATE
-Wall
-Wextra)
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "")
endif()
# --- End of section ---
setup_plugin_target(${CMAKE_PROJECT_NAME})