-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
249 lines (215 loc) · 9.67 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
241
242
243
244
245
246
247
248
249
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(pamworkspace VERSION 1.8.0)
set(CMAKE_INSTALL_PREFIX "/usr/local")
SET(NMOS OFF CACHE BOOL "set to ON to include NMOS")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "NMOS: ${NMOS}")
SET(DIR_PAM $ENV{HOME}/pam CACHE STRING "location for pam config files etc")
SET(DIR_BASE $ENV{HOME} CACHE STRING "base location for external libraries' source")
SET(DIR_NMOS ${DIR_BASE}/nmos CACHE STRING "location of nmos")
SET(DIR_PTPMONKEY ${DIR_BASE}/ptpmonkey CACHE STRING "location of ptpmonkey")
SET(DIR_SAPSERVER ${DIR_BASE}/sapserver CACHE STRING "location of sapserver")
SET(DIR_LIVEWIRE ${DIR_BASE}/livewirediscover CACHE STRING "location of livewire watcher")
SET(DIR_LOG ${DIR_BASE}/log CACHE STRING "location of pml log")
SET(DIR_DNSSD ${DIR_BASE}/dnssd CACHE STRING "location of pml dnssd")
SET(DIR_RESTGOOSE ${DIR_BASE}/Restgoose CACHE STRING "location of Restgoose")
SET(RESTGOOSE_BRANCH "main" CACHE STRING "Restgoose branch to use")
#set the following to off so we build them rather than one of the sub projects
SET(BUILD_DNSSD OFF)
SET(BUILD_LOG OFF)
message(STATUS "Find external libraries")
#Get log
message(STATUS "Find pml::log")
find_path(TEMP_DIR NAMES "CMakeLists.txt" PATHS ${DIR_LOG} NO_CACHE)
if((NOT TEMP_DIR) OR (NOT EXISTS ${TEMP_DIR}))
message(STATUS "log not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/log/ ${DIR_LOG})
find_path(TEMP_DIR2 NAMES "CMakeLists.txt" PATHS ${DIR_LOG} NO_CACHE)
if((NOT TEMP_DIR2) OR (NOT EXISTS ${TEMP_DIR2}))
message(FATAL_ERROR "Failed to clone pml::Log")
endif()
else()
message(STATUS "log found - update to latest version")
execute_process(COMMAND git -C ${DIR_LOG} pull --no-rebase)
endif()
#Get ptpmonkey
message(STATUS "Find pml::ptpmonkey")
find_path(TEMP_DIR3 NAMES "CMakeLists.txt" PATHS ${DIR_PTPMONKEY} NO_CACHE)
if((NOT TEMP_DIR3) OR (NOT EXISTS ${TEMP_DIR3}))
message(STATUS "ptpmonkey not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/ptpmonkey/ ${DIR_PTPMONKEY})
find_path(TEMP_DIR4 NAMES "CMakeLists.txt" PATHS ${DIR_PTPMONKEY} NO_CACHE)
if((NOT TEMP_DIR4) OR (NOT EXISTS ${TEMP_DIR4}))
message(FATAL_ERROR "Failed to clone pml::ptpmonkey")
endif()
else()
message(STATUS "ptpmonkey found - update to latest version")
execute_process(COMMAND git -C ${DIR_PTPMONKEY} pull --no-rebase)
endif()
#Get sapserver
message(STATUS "Find pml::sapserver")
find_path(TEMP_DIR5 NAMES "CMakeLists.txt" PATHS ${DIR_SAPSERVER} NO_CACHE)
if((NOT TEMP_DIR5) OR (NOT EXISTS ${TEMP_DIR5}))
message(STATUS "sapserver not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/sapserver/ ${DIR_SAPSERVER})
find_path(TEMP_DIR6 NAMES "CMakeLists.txt" PATHS ${DIR_SAPSERVER} NO_CACHE)
if((NOT TEMP_DIR6) OR (NOT EXISTS ${TEMP_DIR6}))
message(FATAL_ERROR "Failed to clone pml::sapserver")
endif()
else()
message(STATUS "sapserver found - update to latest version")
execute_process(COMMAND git -C ${DIR_SAPSERVER} pull --no-rebase)
endif()
#Get livewire
message(STATUS "Find pml::livewire")
find_path(TEMP_DIR5 NAMES "CMakeLists.txt" PATHS ${DIR_LIVEWIRE} NO_CACHE)
if((NOT TEMP_DIR5) OR (NOT EXISTS ${TEMP_DIR5}))
message(STATUS "livewire not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/livewirediscover/ ${DIR_LIVEWIRE})
find_path(TEMP_DIR6 NAMES "CMakeLists.txt" PATHS ${DIR_LIVEWIRE} NO_CACHE)
if((NOT TEMP_DIR6) OR (NOT EXISTS ${TEMP_DIR6}))
message(FATAL_ERROR "Failed to clone pml::livewire")
endif()
else()
message(STATUS "livewire found - update to latest version")
execute_process(COMMAND git -C ${DIR_LIVEWIRE} pull --no-rebase)
endif()
#Get dnssd
message(STATUS "Find pml::dnssd")
find_path(TEMP_DIR7 NAMES "CMakeLists.txt" PATHS ${DIR_DNSSD} NO_CACHE)
if((NOT TEMP_DIR7) OR (NOT EXISTS ${TEMP_DIR7}))
message(STATUS "dnssd not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/dnssd/ ${DIR_DNSSD})
find_path(TEMP_DIR8 NAMES "CMakeLists.txt" PATHS ${DIR_DNSSD} NO_CACHE)
if((NOT TEMP_DIR8) OR (NOT EXISTS ${TEMP_DIR8}))
message(FATAL_ERROR "Failed to clone pml::dnssd")
endif()
else()
message(STATUS "pml::dnssd found - update to latest version")
execute_process(COMMAND git -C ${DIR_DNSSD} pull --no-rebase)
endif()
if(${NMOS})
#Get nmos
message(STATUS "Find pml::nmos")
find_path(TEMP_DIR9 NAMES "CMakeLists.txt" PATHS ${DIR_NMOS} NO_CACHE)
if((NOT TEMP_DIR9) OR (NOT EXISTS ${TEMP_DIR9}))
message(STATUS "nmos not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/nmos/ ${DIR_NMOS})
find_path(TEMP_DIR10 NAMES "CMakeLists.txt" PATHS ${DIR_NMOS} NO_CACHE)
if((NOT TEMP_DIR10) OR (NOT EXISTS ${TEMP_DIR10}))
message(FATAL_ERROR "Failed to clone pml::nmos")
endif()
else()
message(STATUS "nmos found - update to latest version")
execute_process(COMMAND git -C ${DIR_NMOS} pull --no-rebase)
endif()
else()
message(STATUS "NMOS support Off - find pml::restgoose")
#Get Restgoose
if(NOT DEFINED BUILD_RESTGOOSE)
SET(BUILD_RESTGOOSE ON)
find_path(EPI_TEMP_DIR NAMES "CMakeLists.txt" PATHS ${DIR_RESTGOOSE})
if((NOT EPI_TEMP_DIR) OR (NOT EXISTS ${EPI_TEMP_DIR}))
message(STATUS "Restgoose not found - clone from GitHub")
execute_process(COMMAND git clone https://github.com/martim01/Restgoose ${DIR_RESTGOOSE})
execute_process(COMMAND git -C ${DIR_RESTGOOSE} checkout ${RESTGOOSE_BRANCH})
find_path(EPI_TEMP_DIR2 NAMES "CMakeLists.txt" PATHS ${DIR_RESTGOOSE})
if((NOT EPI_TEMP_DIR2) OR (NOT EXISTS ${EPI_TEMP_DIR2}))
message(FATAL_ERROR "Failed to clone Restgoose")
endif()
endif()
message(STATUS "Restgoose found - update to latest version")
execute_process(COMMAND git -C ${DIR_RESTGOOSE} checkout ${RESTGOOSE_BRANCH})
execute_process(COMMAND git -C ${DIR_RESTGOOSE} pull)
unset(EPI_TEMP_DIR2)
endif()
unset(NMOS_TEMP_DIR)
endif()
message(STATUS "Configure pml::log")
add_subdirectory(${DIR_LOG} ${CMAKE_SOURCE_DIR}/build/log)
message(STATUS "Configure pml::sapserver")
add_subdirectory(${DIR_SAPSERVER} ${CMAKE_SOURCE_DIR}/build/sapserver)
message(STATUS "Configure pml::ptpmonkey")
add_subdirectory(${DIR_PTPMONKEY} ${CMAKE_SOURCE_DIR}/build/ptpmonkey)
message(STATUS "Configure pml::dnssd")
add_subdirectory(${DIR_DNSSD} ${CMAKE_SOURCE_DIR}/build/dnssd)
message(STATUS "Configure pml::livewire")
add_subdirectory(${DIR_LIVEWIRE} ${CMAKE_SOURCE_DIR}/build/livewirediscover)
if(${NMOS})
message(STATUS "Configure pml::nmos")
add_subdirectory(${DIR_NMOS} ${CMAKE_SOURCE_DIR}/build/nmos)
else()
message(STATUS "Configure pml::restgoose")
add_subdirectory(${DIR_RESTGOOSE} ${CMAKE_SOURCE_DIR}/build/restgoose)
endif()
configure_file(pam2_paths.h.in ${CMAKE_BINARY_DIR}/include/pam2_paths.h @ONLY)
message(STATUS "Configure pambase")
add_subdirectory(pambase)
message(STATUS "Configure pamfft")
add_subdirectory(pamfft)
message(STATUS "Configure pamlevel")
add_subdirectory(pamlevel)
message(STATUS "Configure plugin anglemeters")
add_subdirectory(plugins/anglemeters)
message(STATUS "Configure plugin aoip")
add_subdirectory(plugins/aoip\ info)
message(STATUS "Configure plugin channeldelay")
add_subdirectory(plugins/channel\ delay)
message(STATUS "Configure plugin distortion")
add_subdirectory(plugins/distortion)
message(STATUS "Configure plugin fft")
add_subdirectory(plugins/fft)
message(STATUS "Configure plugin fftphase")
add_subdirectory(plugins/fftphase)
message(STATUS "Configure plugin identify")
add_subdirectory(plugins/identify)
message(STATUS "Configure plugin inputalign")
add_subdirectory(plugins/InputAlign)
message(STATUS "Configure plugin levels")
add_subdirectory(plugins/levels)
message(STATUS "Configure plugin lineup")
add_subdirectory(plugins/lineup)
message(STATUS "Configure plugin lissajou")
add_subdirectory(plugins/lissajou)
message(STATUS "Configure plugin LTC")
add_subdirectory(plugins/LTC)
message(STATUS "Configure plugin LTCGenerator")
add_subdirectory(plugins/LTCGenerator)
message(STATUS "Configure plugin meters")
add_subdirectory(plugins/meters)
message(STATUS "Configure plugin noise")
add_subdirectory(plugins/noiseGenerator)
message(STATUS "Configure plugin peakcount")
add_subdirectory(plugins/peak\ count)
message(STATUS "Configure plugin peaklog")
add_subdirectory(plugins/peak\ log)
message(STATUS "Configure plugin polarscope")
add_subdirectory(plugins/polarscope)
message(STATUS "Configure plugin ptp")
add_subdirectory(plugins/ptp)
message(STATUS "Configure plugin r128")
add_subdirectory(plugins/r128)
message(STATUS "Configure plugin radar")
add_subdirectory(plugins/radar)
message(STATUS "Configure plugin record")
add_subdirectory(plugins/record)
message(STATUS "Configure plugin scope")
add_subdirectory(plugins/scope)
message(STATUS "Configure plugin spectogram")
add_subdirectory(plugins/spectogram)
message(STATUS "Configure plugin waveform")
add_subdirectory(plugins/waveform)
message(STATUS "Configure plugin fftdiff")
add_subdirectory(plugins/fftdiff)
message(STATUS "Configure plugin correlation")
add_subdirectory(plugins/correlation)
#Add new plugin projects above this line
message(STATUS "Configure pam2")
add_subdirectory(pam2)
message(STATUS "Configure pamupdatemanager")
add_subdirectory(pamupdatemanager)
message(STATUS "Configure InitialSetup")
add_subdirectory(InitialSetup)
add_subdirectory(dosetup)
include(${CMAKE_SOURCE_DIR}/CMakeCPack.cmake)
include(CPack)