forked from zynthian/zyncoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
240 lines (203 loc) · 14.3 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
cmake_minimum_required(VERSION 3.0)
#project(zyncore LANGUAGES CXX)
project(zyncore)
include(CheckIncludeFiles)
include(CheckLibraryExists)
link_directories(/usr/local/lib)
if (("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ENCODERS")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ENCODERS_V5TOUCH")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EXTRA")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EPDF")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_EPDF_REVERSE")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ZynScreen")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ZynScreen_Zynaptik")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_ZynScreen_Zynface")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_Zynaptik-3")
OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MCP23017_Zynaptik-3_Zynface"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
if (DEFINED ENV{ZYNTHIAN_WIRING_MCP23017_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_MCP23017_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined MCP23017_I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_MCP23017_I2C_ADDRESS}")
add_definitions(-DMCP23017_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_MCP23017_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_MCP23017_INTA_PIN} AND NOT ("$ENV{ZYNTHIAN_WIRING_MCP23017_INTA_PIN}" STREQUAL ""))
message("++ Defined MCP23017_INTA_PIN $ENV{ZYNTHIAN_WIRING_MCP23017_INTA_PIN}")
add_definitions(-DMCP23017_INTA_PIN=$ENV{ZYNTHIAN_WIRING_MCP23017_INTA_PIN})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_MCP23017_INTB_PIN} AND NOT ("$ENV{ZYNTHIAN_WIRING_MCP23017_INTB_PIN}" STREQUAL ""))
message("++ Defined MCP23017_INTB_PIN $ENV{ZYNTHIAN_WIRING_MCP23017_INTB_PIN}")
add_definitions(-DMCP23017_INTB_PIN=$ENV{ZYNTHIAN_WIRING_MCP23017_INTB_PIN})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CONFIG $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}")
add_definitions(-DZYNAPTIK_CONFIG="$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}")
set(BUILD_ZYNAPTIK "1")
if ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}" MATCHES "^Custom")
message("++ Defined ZYNAPTIK_VERSION 1")
add_definitions(-DZYNAPTIK_VERSION=1)
elseif("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}" MATCHES "^Zynaptik-2")
message("++ Defined ZYNAPTIK_VERSION 2")
add_definitions(-DZYNAPTIK_VERSION=2)
elseif("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}" MATCHES "^Zynaptik-3")
message("++ Defined ZYNAPTIK_VERSION 3")
add_definitions(-DZYNAPTIK_VERSION=3)
elseif("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}" MATCHES "^Zynface-V5")
message("++ Defined ZYNAPTIK_VERSION 5")
add_definitions(-DZYNAPTIK_VERSION=5)
endif()
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined ZYNAPTIK_MCP23017_I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_I2C_ADDRESS}")
add_definitions(-DZYNAPTIK_MCP23017_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTA_PIN} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTA_PIN}" STREQUAL ""))
message("++ Defined ZYNAPTIK_MCP23017_INTA_PIN $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTA_PIN}")
add_definitions(-DZYNAPTIK_MCP23017_INTA_PIN=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTA_PIN})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTB_PIN} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTB_PIN}" STREQUAL ""))
message("++ Defined ZYNAPTIK_MCP23017_INTB_PIN $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTB_PIN}")
add_definitions(-DZYNAPTIK_MCP23017_INTB_PIN=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP23017_INTB_PIN})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined ZYNAPTIK_ADS1115 I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS}")
add_definitions(-DZYNAPTIK_ADS1115_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined ZYNAPTIK_MCP4728 I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS}")
add_definitions(-DZYNAPTIK_MCP4728_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNTOF_CONFIG} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNTOF_CONFIG}" STREQUAL ""))
message("++ Defined ZYNTOF_CONFIG $ENV{ZYNTHIAN_WIRING_ZYNTOF_CONFIG}")
add_definitions(-DZYNTOF_CONFIG="$ENV{ZYNTHIAN_WIRING_ZYNTOF_CONFIG}")
set(BUILD_ZYNTOF "1")
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVIN_VOLTS_OCTAVE $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE}")
add_definitions(-DZYNAPTIK_CVIN_VOLTS_OCTAVE=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVOUT_VOLTS_OCTAVE $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE}")
add_definitions(-DZYNAPTIK_CVOUT_VOLTS_OCTAVE=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVIN_NOTE0 $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0}")
add_definitions(-DZYNAPTIK_CVIN_NOTE0=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVOUT_NOTE0 $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0}")
add_definitions(-DZYNAPTIK_CVOUT_NOTE0=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0})
endif()
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V1"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
add_definitions(-DZ2_VERSION=1)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V2"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
add_definitions(-DZ2_VERSION=2)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V3"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
add_definitions(-DZ2_VERSION=3)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "V5"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
add_definitions(-DV5_VERSION=1)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MINI_V2"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
add_definitions(-DMINI_VERSION=2)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "V5_ZYNFACE"))
message("++ Defined MCP23017_ENCODERS")
add_definitions(-DMCP23017_ENCODERS)
message("++ Defined ZYNAPTIK_CONFIG $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}")
add_definitions(-DZYNAPTIK_CONFIG="$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CONFIG}")
message("++ Defined ZYNAPTIK_VERSION 5")
add_definitions(-DZYNAPTIK_VERSION=5)
add_definitions(-DZYNAPTIK_MCP23017_BASE_PIN=400)
add_definitions(-DZYNAPTIK_MCP23017_I2C_ADDRESS=0x22)
add_definitions(-DZYNAPTIK_MCP23017_INTA_PIN=5)
add_definitions(-DZYNAPTIK_MCP23017_INTB_PIN=4)
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined ZYNAPTIK_ADS1115 I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS}")
add_definitions(-DZYNAPTIK_ADS1115_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_ADS1115_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS}" STREQUAL ""))
message("++ Defined ZYNAPTIK_MCP4728 I2C_ADDRESS $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS}")
add_definitions(-DZYNAPTIK_MCP4728_I2C_ADDRESS=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_MCP4728_I2C_ADDRESS})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVIN_VOLTS_OCTAVE $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE}")
add_definitions(-DZYNAPTIK_CVIN_VOLTS_OCTAVE=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_VOLTS_OCTAVE})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVOUT_VOLTS_OCTAVE $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE}")
add_definitions(-DZYNAPTIK_CVOUT_VOLTS_OCTAVE=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_VOLTS_OCTAVE})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVIN_NOTE0 $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0}")
add_definitions(-DZYNAPTIK_CVIN_NOTE0=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVIN_NOTE0})
endif()
if (DEFINED ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0} AND NOT ("$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0}" STREQUAL ""))
message("++ Defined ZYNAPTIK_CVOUT_NOTE0 $ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0}")
add_definitions(-DZYNAPTIK_CVOUT_NOTE0=$ENV{ZYNTHIAN_WIRING_ZYNAPTIK_CVOUT_NOTE0})
endif()
set(BUILD_ZYNAPTIK "1")
add_definitions(-DV5_VERSION=1)
elseif(("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "DUMMIES"))
message("++ Defined DUMMY_ENCODERS")
add_definitions(-DDUMMY_ENCODERS)
else()
message("++ Defined MCP23008_ENCODERS")
add_definitions(-DMCP23008_ENCODERS)
endif()
if (DEFINED ENV{TPA6130_KERNEL_DRIVER_LOADED} AND ("$ENV{TPA6130_KERNEL_DRIVER_LOADED}" STREQUAL "1"))
message("++ TPA6130 kernel driver LOADED. Omitting user space driver.")
else()
message("++ TPA6130 kernel driver NOT LOADED. Using TPA6130 user space driver if needed.")
add_definitions(-DTPA6130_DRIVER)
endif()
message("++ Building for Wiring Layout $ENV{ZYNTHIAN_WIRING_LAYOUT}")
set_source_files_properties( zynrv112.c PROPERTIES LANGUAGE CXX LINKER_LANGUAGE CXX)
if (("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V1") OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V2") OR ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "Z2_V3"))
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_z2.c lm4811.h lm4811.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo)
add_executable(lm4811_set_volume lm4811_set_volume.c lm4811.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(lm4811_set_volume gpiod pthread)
elseif ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "V5")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_v5.c tpa6130.c tpa6130.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo)
add_executable(tpa6130_set_volume tpa6130_set_volume.c tpa6130.c wiringPiI2C.h wiringPiI2C.c)
target_link_libraries(tpa6130_set_volume gpiod)
elseif ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "MINI_V2")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_mini_v2.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo)
elseif ("$ENV{ZYNTHIAN_WIRING_LAYOUT}" STREQUAL "V5_ZYNFACE")
message("++ Building Zynaptik support")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_v5.c tpa6130.c tpa6130.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c zynaptik.h zynaptik.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack MCP4728 lo)
add_executable(tpa6130_set_volume tpa6130_set_volume.c tpa6130.c wiringPiI2C.h wiringPiI2C.c)
target_link_libraries(tpa6130_set_volume gpiod)
add_executable(mcp4728_set_address mcp4728_set_address.c)
target_link_libraries(mcp4728_set_address MCP4728)
else ()
if (BUILD_ZYNTOF AND BUILD_ZYNAPTIK)
message("++ Building Zynaptik & Zyntof support")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_vx.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c zynaptik.h zynaptik.c zyntof.h zyntof.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo MCP4728 tof)
elseif (BUILD_ZYNAPTIK)
message("++ Building Zynaptik support")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_vx.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c zynaptik.h zynaptik.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack MCP4728 lo)
elseif (BUILD_ZYNTOF)
message("++ Building Zyntof support")
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_vx.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c zyntof.h zyntof.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo tof)
else()
add_library(zyncore SHARED zyncore.c zyncontrol.h zyncontrol_vx.c zynpot.h zynpot.c zynrv112.h zynrv112.c zynads1115.h zynads1115.c zynmcp23017.h zynmcp23017.c zynmcp23008.h zynmcp23008.c zyncoder.h zyncoder.c zynmidirouter.h zynmidirouter.c zynmaster.h zynmaster.c wiringPiI2C.h wiringPiI2C.c gpiod_callback.h gpiod_callback.c)
target_link_libraries(zyncore gpiod jack lo)
endif()
endif()
add_executable(zyncoder_test zyncoder_test.c)
target_link_libraries(zyncoder_test zyncore)
install(TARGETS zyncore LIBRARY DESTINATION lib)