-
Notifications
You must be signed in to change notification settings - Fork 48
/
BuildSoapySDR.cmake
368 lines (344 loc) · 12.4 KB
/
BuildSoapySDR.cmake
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
############################################################
## Pothos SDR environment build sub-script
##
## This script builds SoapySDR and support modules
##
## * SoapySDR
## * SoapyAirspy
## * SoapyAirspyHF
## * SoapyBladeRF
## * SoapyHackRF
## * SoapyUHD
## * SoapyOsmo
## * SoapyRTLSDR
## * SoapyRemote
## * SoapyRedPitaya
## * SoapyAudio
## * SoapyS9CExtIO
## * SoapyRxTools
## * SoapyIris
## * SoapyPlutoSDR
## * LimeSuite
## * SoapyNetSDR
############################################################
set(SOAPY_SDR_BRANCH master)
set(SOAPY_REMOTE_BRANCH master)
set(SOAPY_AIRSPY_BRANCH master)
set(SOAPY_AIRSPYHF_BRANCH master)
set(SOAPY_BLADERF_BRANCH master)
set(SOAPY_HACKRF_BRANCH master)
set(SOAPY_UHD_BRANCH master)
set(SOAPY_OSMO_BRANCH master)
set(SOAPY_RTLSDR_BRANCH master)
set(SOAPY_RED_PITAYA_BRANCH master)
set(SOAPY_AUDIO_BRANCH master)
set(SOAPY_SDRPLAY_BRANCH master)
set(SOAPY_RX_TOOLS_BRANCH master)
set(SOAPY_IRIS_BRANCH master)
set(SOAPY_PLUTO_SDR_BRANCH master)
set(LIME_SUITE_BRANCH master)
set(SOAPY_NET_SDR_BRANCH master)
############################################################
## Build SoapySDR
############################################################
MyExternalProject_Add(SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapySDR.git
GIT_TAG ${SOAPY_SDR_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DSOAPY_SDR_EXTVER=${EXTRA_VERSION_INFO}
-DENABLE_PYTHON=OFF
-DENABLE_PYTHON3=OFF
LICENSE_FILES LICENSE_1_0.txt
)
#disabling env SOAPY_SDR_ROOT because library can use relative path to dll
#set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
#WriteRegStr HKEY_LOCAL_MACHINE \\\"${NSIS_ENV}\\\" \\\"SOAPY_SDR_ROOT\\\" \\\"$INSTDIR\\\"
#")
#set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
#DeleteRegValue HKEY_LOCAL_MACHINE \\\"${NSIS_ENV}\\\" \\\"SOAPY_SDR_ROOT\\\"
#")
############################################################
## Build SoapySDR python bindings
############################################################
MyExternalProject_Add(SoapySDRPython3
DEPENDS swig SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapySDR.git
GIT_TAG ${SOAPY_SDR_BRANCH}
CONFIGURE_COMMAND
"${CMAKE_COMMAND}" <SOURCE_DIR>/python
-G ${CMAKE_GENERATOR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DPYTHON_EXECUTABLE=${PYTHON3_EXECUTABLE}
-DPYTHON_INCLUDE_DIR=${PYTHON3_INCLUDE_DIR}
-DPYTHON_LIBRARY=${PYTHON3_LIBRARY}
-DPYTHON_INSTALL_DIR=${PYTHON3_INSTALL_DIR}
-DSWIG_EXECUTABLE=${SWIG_EXECUTABLE}
-DSWIG_DIR=${SWIG_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} --target install
LICENSE_FILES LICENSE_1_0.txt
)
############################################################
## Build SoapyAirspy
############################################################
MyExternalProject_Add(SoapyAirspy
DEPENDS SoapySDR airspy
GIT_REPOSITORY https://github.com/pothosware/SoapyAirspy.git
GIT_TAG ${SOAPY_AIRSPY_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.txt
)
############################################################
## Build SoapyAirspyHF
############################################################
MyExternalProject_Add(SoapyAirspyHF
DEPENDS SoapySDR airspyhf
GIT_REPOSITORY https://github.com/pothosware/SoapyAirspyHF.git
GIT_TAG ${SOAPY_AIRSPYHF_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.txt
)
############################################################
## Build SoapyBladeRF
############################################################
MyExternalProject_Add(SoapyBladeRF
DEPENDS SoapySDR bladeRF
GIT_REPOSITORY https://github.com/pothosware/SoapyBladeRF.git
GIT_TAG ${SOAPY_BLADERF_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.LGPLv2.1
)
############################################################
## Build SoapyHackRF
############################################################
MyExternalProject_Add(SoapyHackRF
DEPENDS SoapySDR hackRF
GIT_REPOSITORY https://github.com/pothosware/SoapyHackRF.git
GIT_TAG ${SOAPY_HACKRF_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DLIBHACKRF_INCLUDE_DIR=${CMAKE_INSTALL_PREFIX}/include/libhackrf
-DLIBHACKRF_LIBRARY=${CMAKE_INSTALL_PREFIX}/lib/hackrf.lib
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE
)
############################################################
## Build SoapyOsmo
##
## * ENABLE_RFSPACE=OFF see Soapy NetSDR
## * ENABLE_BLADERF=OFF see Soapy BladeRF
## * ENABLE_HACKRF=OFF see Soapy HackRF
## * ENABLE_RTL=OFF see Soapy RTL-SDR
## * ENABLE_AIRSPY=OFF see Soapy Airspy
############################################################
if (EXISTS ${BOOST_ROOT})
MyExternalProject_Add(SoapyOsmo
DEPENDS SoapySDR osmo-sdr miri-sdr #airspy bladeRF hackRF rtl-sdr
GIT_REPOSITORY https://github.com/pothosware/SoapyOsmo.git
GIT_TAG ${SOAPY_OSMO_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DBOOST_ROOT=${BOOST_ROOT}
-DBOOST_LIBRARYDIR=${BOOST_LIBRARYDIR}
-DENABLE_RFSPACE=OFF
-DENABLE_BLADERF=OFF
-DENABLE_HACKRF=OFF
-DENABLE_RTL=OFF
-DENABLE_AIRSPY=OFF
-DENABLE_OSMOSDR=ON
-DENABLE_MIRI=ON
LICENSE_FILES COPYING
)
else()
message(STATUS "Boost missing, skipping SoapyOsmo...")
endif()
############################################################
## Build SoapyRTLSDR
############################################################
MyExternalProject_Add(SoapyRTLSDR
DEPENDS SoapySDR rtl-sdr
GIT_REPOSITORY https://github.com/pothosware/SoapyRTLSDR.git
GIT_TAG ${SOAPY_RTLSDR_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.txt
)
############################################################
## Build SoapyRemote
############################################################
MyExternalProject_Add(SoapyRemote
DEPENDS SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapyRemote.git
GIT_TAG ${SOAPY_REMOTE_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE_1_0.txt
)
############################################################
## Build SoapyUHD
############################################################
if (EXISTS ${BOOST_ROOT})
MyExternalProject_Add(SoapyUHD
DEPENDS SoapySDR uhd
GIT_REPOSITORY https://github.com/pothosware/SoapyUHD.git
GIT_TAG ${SOAPY_UHD_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DBOOST_ROOT=${BOOST_ROOT}
-DBOOST_LIBRARYDIR=${BOOST_LIBRARYDIR}
-DUHD_INCLUDE_DIRS=${UHD_INCLUDE_DIRS}
-DUHD_LIBRARIES=${UHD_LIBRARIES}
LICENSE_FILES COPYING
)
else()
message(STATUS "Boost missing, skipping SoapyUHD...")
endif()
############################################################
## Build SoapyRedPitaya
############################################################
MyExternalProject_Add(SoapyRedPitaya
DEPENDS SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapyRedPitaya.git
GIT_TAG ${SOAPY_RED_PITAYA_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES COPYING
)
############################################################
## Build SoapyAudio
############################################################
MyExternalProject_Add(SoapyAudio
DEPENDS SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapyAudio.git
GIT_TAG ${SOAPY_AUDIO_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.txt
)
############################################################
## Build SoapySDRPlay
############################################################
if (EXISTS "${SDRPLAY_API_DIR}")
MyExternalProject_Add(SoapySDRPlay3
DEPENDS SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapySDRPlay3
GIT_TAG ${SOAPY_SDRPLAY_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES LICENSE.txt
)
else ()
message(STATUS "!Skipping SoapySDRPlay3 - sdrplay_api not found")
endif ()
############################################################
## Build SoapyRxTools
############################################################
MyExternalProject_Add(SoapyRxTools
DEPENDS SoapySDR Pthreads
GIT_REPOSITORY https://github.com/rxseger/rx_tools.git
GIT_TAG ${SOAPY_RX_TOOLS_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DTHREADS_PTHREADS_INCLUDE_DIR=${THREADS_PTHREADS_INCLUDE_DIR}
-DTHREADS_PTHREADS_WIN32_LIBRARY=${THREADS_PTHREADS_WIN32_LIBRARY}
LICENSE_FILES COPYING
)
############################################################
## Build Skylark's Iris support
############################################################
MyExternalProject_Add(SoapyIris
DEPENDS SoapySDR SoapyRemote
GIT_REPOSITORY https://github.com/skylarkwireless/sklk-soapyiris.git
GIT_TAG ${SOAPY_IRIS_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES BSD-3-CLAUSE-LICENSE.txt
)
############################################################
## Build SoapyPlutoSDR
############################################################
MyExternalProject_Add(SoapyPlutoSDR
DEPENDS SoapySDR libad9361
GIT_REPOSITORY https://github.com/pothosware/SoapyPlutoSDR.git
GIT_TAG ${SOAPY_PLUTO_SDR_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DLIBIIO_INCLUDE_DIR=${LIBIIO_INCLUDE_DIR}
-DLIBIIO_LIBRARY=${LIBIIO_LIBRARY}
LICENSE_FILES LICENSE
)
############################################################
## Build LimeSuite
##
## -DWX_ROOT_DIR is a hack to prevent FindwxWidgets.cmake
## from clearing wxWidgets_LIB_DIR the first configuration.
##
## -DFX3_SDK_PATH specifies the USB support for LimeSuite
## If the SDK is not present, USB support will be disabled.
##
############################################################
MyExternalProject_Add(LimeSuite
DEPENDS SoapySDR wxWidgets
GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git
GIT_TAG ${LIME_SUITE_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DLIME_SUITE_EXTVER=${EXTRA_VERSION_INFO}
-DWX_ROOT_DIR=${wxWidgets_ROOT_DIR}
-DwxWidgets_ROOT_DIR=${wxWidgets_ROOT_DIR}
-DwxWidgets_LIB_DIR=${wxWidgets_LIB_DIR}
-DSoapySDR_DIR=${CMAKE_INSTALL_PREFIX}
-DFX3_SDK_PATH=${FX3_SDK_PATH}
LICENSE_FILES COPYING
)
list(APPEND CPACK_PACKAGE_EXECUTABLES "LimeSuiteGUI" "Lime Suite")
list(APPEND CPACK_CREATE_DESKTOP_LINKS "LimeSuiteGUI")
############################################################
## Build SoapyNetSDR
############################################################
MyExternalProject_Add(SoapyNetSDR
DEPENDS SoapySDR
GIT_REPOSITORY https://github.com/pothosware/SoapyNetSDR.git
GIT_TAG ${SOAPY_NET_SDR_BRANCH}
CMAKE_DEFAULTS ON
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
LICENSE_FILES License.txt
)