forked from jevois/jevoisbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
478 lines (402 loc) · 29.2 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
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
######################################################################################################################
#
# JeVois Smart Embedded Machine Vision Toolkit - Copyright (C) 2016 by Laurent Itti, the University of Southern
# California (USC), and iLab at USC. See http://iLab.usc.edu and http://jevois.org for information about this project.
#
# This file is part of the JeVois Smart Embedded Machine Vision Toolkit. This program is free software; you can
# redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details. You should have received a copy of the GNU General Public License along with this program;
# if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contact information: Laurent Itti - 3641 Watt Way, HNB-07A - Los Angeles, BA 90089-2520 - USA.
# Tel: +1 213 740 3527 - itti@pollux.usc.edu - http://iLab.usc.edu - http://jevois.org
######################################################################################################################
# CMake build rules for JeVois Base library and executables
# You may provide the installed JeVois config root and version as:
# cmake -DJEVOIS_CONFIG=/jevois/config ..
cmake_minimum_required(VERSION 3.1)
# Set vendor name, our modules will be placed in a directory by that name under /jevois/modules:
set(JEVOIS_VENDOR "JeVois")
set(JEVOIS_CONFIG "/jevois/config" CACHE STRING "Path to JeVois config to use")
# Include our helper functions, config, etc from the JeVois install:
set(CMAKE_MODULE_PATH ${JEVOIS_CONFIG})
include(jevois_config)
include(JeVois)
# Set project name, detects compiler (which has been set by our helper module). Then set some complation flags:
project(jevoisbase CXX C ASM) # NNPACK has a few assembly sources, darknet and others are C
jevois_project_set_flags()
set(JVB "${CMAKE_CURRENT_SOURCE_DIR}")
# Allow #include <jevoibase/x/y> in our components and modules:
include_directories("include")
# Allow #include <jevoibase/Contrib/x/y> in our components and modules:
include_directories("..")
# Setup our library using the source files in src/Components and call it jevoisbase with the current version number:
jevois_setup_library(src/Components jevoisbase 1.15.0)
# Setup our modules that are in src/Modules, make them depend on jevoisbase:
jevois_setup_modules(src/Modules jevoisbase)
# Add includes to our install / distribution package:
add_subdirectory(include)
# Now setup any additional includes and sources that we will add to the jevoisbase library for use by our individual
# modules, typically those are in the Contrib/ drectory:
########################################################################################################################
# OpenGL-ES libraries on platform (and they also exist on host):
target_link_libraries(jevoisbase GLESv2 EGL)
########################################################################################################################
# Add any needed boost libraries that are not already pulled in by libjevois:
target_link_libraries(jevoisbase boost_regex)
########################################################################################################################
# tiny-dnn support:
include_directories(Contrib)
include_directories(Contrib/tiny-dnn)
include_directories(Contrib/pthreadpool/include)
target_sources(jevoisbase PRIVATE Contrib/pthreadpool/src/threadpool-pthreads.c)
########################################################################################################################
# darknet with NNPACK support: (on top of things already pulled in by tiny-dnn)
include_directories(Contrib/NNPACK/include)
include_directories(Contrib/NNPACK/src)
include_directories(Contrib/FP16/include)
include_directories(Contrib/FXdiv/include)
include_directories(Contrib/psimd/include)
# Library cpuinfo (dependency for NNPACK):
include_directories(Contrib/cpuinfo/include)
include_directories(Contrib/cpuinfo/deps/clog/include)
include_directories(Contrib/cpuinfo/src)
set(CPUI "${JVB}/Contrib/cpuinfo/src")
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/cpuinfo/deps/clog/src/clog.c ${CPUI}/init.c ${CPUI}/api.c
${CPUI}/linux/gpu.c ${CPUI}/linux/smallfile.c ${CPUI}/linux/processors.c ${CPUI}/linux/current.c
${CPUI}/linux/multiline.c ${CPUI}/linux/api.h ${CPUI}/linux/cpulist.c)
if (JEVOIS_PLATFORM)
target_sources(jevoisbase PRIVATE ${CPUI}/arm/uarch.c ${CPUI}/arm/cache.c ${CPUI}/arm/linux/init.c
${CPUI}/arm/linux/cpuinfo.c ${CPUI}/arm/linux/clusters.c ${CPUI}/arm/linux/chipset.c ${CPUI}/arm/linux/midr.c
${CPUI}/arm/linux/hwcap.c ${CPUI}/arm/linux/aarch32-isa.c)
else (JEVOIS_PLATFORM)
target_sources(jevoisbase PRIVATE ${CPUI}/x86/init.c ${CPUI}/x86/info.c ${CPUI}/x86/vendor.c ${CPUI}/x86/uarch.c
${CPUI}/x86/name.c ${CPUI}/x86/topology.c ${CPUI}/x86/isa.c ${CPUI}/x86/cache/init.c ${CPUI}/x86/cache/descriptor.c
${CPUI}/x86/cache/deterministic.c ${CPUI}/x86/linux/init.c ${CPUI}/x86/linux/cpuinfo.c)
endif(JEVOIS_PLATFORM)
# NNPACK: Core
set(NNPS "${JVB}/Contrib/NNPACK/src")
target_sources(jevoisbase PRIVATE ${NNPS}/init.c)
target_sources(jevoisbase PRIVATE ${NNPS}/convolution-output.c)
target_sources(jevoisbase PRIVATE ${NNPS}/convolution-input-gradient.c)
target_sources(jevoisbase PRIVATE ${NNPS}/convolution-kernel-gradient.c)
target_sources(jevoisbase PRIVATE ${NNPS}/convolution-inference.c)
target_sources(jevoisbase PRIVATE ${NNPS}/fully-connected-output.c)
target_sources(jevoisbase PRIVATE ${NNPS}/fully-connected-inference.c)
target_sources(jevoisbase PRIVATE ${NNPS}/pooling-output.c)
target_sources(jevoisbase PRIVATE ${NNPS}/softmax-output.c)
target_sources(jevoisbase PRIVATE ${NNPS}/relu-output.c)
target_sources(jevoisbase PRIVATE ${NNPS}/relu-input-gradient.c)
if (JEVOIS_PLATFORM)
# Transformations
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/2d-fourier-8x8.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/2d-fourier-16x16.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/2d-winograd-8x8-3x3.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/2d-winograd-8x8-3x3-fp16.c)
# ReLU and Softmax
target_sources(jevoisbase PRIVATE ${NNPS}/neon/relu.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/softmax.c)
# FFT block accumulation
#target_sources(jevoisbase PRIVATE ${NNPS}/psimd/fft-block-mac.c)
# Tuple GEMM
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/h4gemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/s4gemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/c4gemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/s4c2gemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/c4gemm-conjb.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/s4c2gemm-conjb.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/c4gemm-conjb-transc.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/s4c2gemm-conjb-transc.c)
# Direct convolution
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/conv1x1.c)
# BLAS microkernels
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/sgemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/sdotxf.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/blas/shdotxf.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/h4gemm-aarch32.S)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/s4gemm-aarch32.S)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/blas/sgemm-aarch32.S)
# FFT and Winograd
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/fft-aos.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/fft-soa.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/fft-real.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/fft-dualreal.c)
target_sources(jevoisbase PRIVATE ${NNPS}/neon/winograd-f6k3.c)
target_sources(jevoisbase PRIVATE ${NNPS}/psimd/exp.c)
add_definitions(-DARM_NEON)
else (JEVOIS_PLATFORM)
# NOTE: on host we just use scalar as opposed to x86 SIMD extensions
# Transformations
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/2d-fourier-8x8.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/2d-fourier-16x16.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/2d-winograd-8x8-3x3.c)
# ReLU and Softmax
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/relu.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/softmax.c)
# Tuple GEMM
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/s2gemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/s2gemm-transc.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/cgemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/cgemm-conjb.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/cgemm-conjb-transc.c)
# Direct convolution
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/conv1x1.c)
# BLAS microkernels
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/sgemm.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/sdotxf.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/blas/shdotxf.c)
# FFT and Winograd
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/fft-aos.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/fft-soa.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/fft-real.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/fft-dualreal.c)
target_sources(jevoisbase PRIVATE ${NNPS}/scalar/winograd-f6k3.c)
add_definitions(-DNNP_BACKEND_SCALAR=1)
endif(JEVOIS_PLATFORM)
add_definitions(-DNNPACK)
# Now darknet-nnpack proper:
include_directories(Contrib/darknet-nnpack/include)
set(DKNS "${JVB}/Contrib/darknet-nnpack/src")
add_definitions(-DDARKNET_NNPACK)
# Or use the baseline darknet instead (much slower):
#include_directories(Contrib/darknet/include)
#set(DKNS "${JVB}/Contrib/darknet/src")
target_sources(jevoisbase PRIVATE ${DKNS}/gemm.c ${DKNS}/utils.c ${DKNS}/cuda.c ${DKNS}/deconvolutional_layer.c
${DKNS}/convolutional_layer.c ${DKNS}/list.c ${DKNS}/image.c ${DKNS}/activations.c ${DKNS}/im2col.c ${DKNS}/col2im.c
${DKNS}/blas.c ${DKNS}/crop_layer.c ${DKNS}/dropout_layer.c ${DKNS}/maxpool_layer.c ${DKNS}/softmax_layer.c
${DKNS}/data.c ${DKNS}/matrix.c ${DKNS}/network.c ${DKNS}/connected_layer.c ${DKNS}/cost_layer.c ${DKNS}/parser.c
${DKNS}/option_list.c ${DKNS}/detection_layer.c ${DKNS}/route_layer.c ${DKNS}/box.c ${DKNS}/normalization_layer.c
${DKNS}/avgpool_layer.c ${DKNS}/layer.c ${DKNS}/local_layer.c ${DKNS}/shortcut_layer.c ${DKNS}/activation_layer.c
${DKNS}/rnn_layer.c ${DKNS}/gru_layer.c ${DKNS}/crnn_layer.c ${DKNS}/demo.c ${DKNS}/batchnorm_layer.c
${DKNS}/region_layer.c ${DKNS}/reorg_layer.c ${DKNS}/tree.c ${DKNS}/lstm_layer.c ${DKNS}/yolo_layer.c
${DKNS}/upsample_layer.c)
########################################################################################################################
# ZZBar barcode / QR-code source files:
include_directories(Contrib/ZBar/include Contrib/ZBar/zbar)
set(ZBS "${JVB}/Contrib/ZBar/zbar")
target_sources(jevoisbase PRIVATE ${ZBS}/processor.c ${ZBS}/scanner.c ${ZBS}/symbol.c ${ZBS}/img_scanner.c
${ZBS}/qrcode/rs.c ${ZBS}/qrcode/isaac.c ${ZBS}/qrcode/util.c ${ZBS}/qrcode/qrdectxt.c ${ZBS}/qrcode/bch15_5.c
${ZBS}/qrcode/binarize.c ${ZBS}/qrcode/qrdec.c ${ZBS}/config.c ${ZBS}/error.c ${ZBS}/processor/posix.c
${ZBS}/processor/lock.c ${ZBS}/processor/null.c ${ZBS}/convert.c ${ZBS}/decoder/i25.c ${ZBS}/decoder/qr_finder.c
${ZBS}/decoder/code128.c ${ZBS}/decoder/codabar.c ${ZBS}/decoder/code39.c ${ZBS}/decoder/databar.c
${ZBS}/decoder/ean.c ${ZBS}/decoder/code93.c ${ZBS}/image.c ${ZBS}/refcnt.c ${ZBS}/decoder.c)
# ${ZBS}/decoder/pdf417.c
# FIXME need to debug zbar as it gives some warnings
add_definitions(-Wparentheses -w)
########################################################################################################################
# cvEyeTracker eye-tracking
# This uses legacy opencv API which is not supported anymore in opencv 4.x.
#target_sources(jevoisbase PRIVATE ${JVB}/Contrib/cvEyeTracker-1.2.5/ransac_ellipse.cpp
# ${JVB}/Contrib/cvEyeTracker-1.2.5/remove_corneal_reflection.cpp ${JVB}/Contrib/cvEyeTracker-1.2.5/svd.c)
########################################################################################################################
# Neon-accelerated Ne10 support. NOTE: as of JeVois 1.13.0, Ne10 is also installed on platform by default as a library,
# may want to use that in new code:
include_directories(Contrib/Ne10/inc)
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/Ne10/modules/imgproc/NE10_boxfilter.c)
if (JEVOIS_PLATFORM)
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/Ne10/modules/imgproc/NE10_boxfilter.neon.c)
endif (JEVOIS_PLATFORM)
########################################################################################################################
# VLfeat support:
include_directories(Contrib/vlfeat/vl)
# Add VLfeat sources shared among various algorithms:
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/vlfeat/vl/host.c ${JVB}/Contrib/vlfeat/vl/generic.c
${JVB}/Contrib/vlfeat/vl/imopv.c)
# The source code for SSE2 convolution seems to be missing...
add_definitions(-DVL_DISABLE_SSE2)
# Other defs to make VLfeat comile:
add_definitions(-DVL_COMPILER_GNUC -DVL_ARCH_LITTLE_ENDIAN)
# Add VLfeat sources used by DenseSift module:
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/vlfeat/vl/dsift.c ${JVB}/Contrib/vlfeat/vl/sift.c)
########################################################################################################################
# Fast optical flow
include_directories(Contrib/OF_DIS)
target_sources(jevoisbase PRIVATE ${JVB}/Contrib/OF_DIS/oflow.cpp ${JVB}/Contrib/OF_DIS/refine_variational.cpp
${JVB}/Contrib/OF_DIS/patchgrid.cpp ${JVB}/Contrib/OF_DIS/patch.cpp ${JVB}/Contrib/OF_DIS/FDF1.0.1/image.c
${JVB}/Contrib/OF_DIS/FDF1.0.1/opticalflow_aux.c ${JVB}/Contrib/OF_DIS/FDF1.0.1/solver.c)
# Select mode 1 (optical flow) and 1 channel (grayscale):
add_definitions(-DSELECTMODE=1 -DSELECTCHANNEL=1)
# Fix path assumptions in the optical flow code for Eigen:
if (JEVOIS_PLATFORM)
add_definitions(-I${JEVOIS_BUILDROOT_BASE}/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/eigen3)
else (JEVOIS_PLATFORM)
add_definitions(-I/usr/include/eigen3)
endif (JEVOIS_PLATFORM)
# Enable OpenMP, which can accelerate the fast optical flow code. NOTE: With small images and when running on a fast
# Intel-based host, this actually slows down the code by 10x or so, probably the parallelism overhead is not worth it
# for small images. Yet, we enable it here as it seems to help on the platform:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fopenmp")
add_definitions(-DWITH_OPENMP -DUSE_PARALLEL_ON_FLOWAGGR)
########################################################################################################################
# ARtoolkit
# When installing ARtoolkit from scratch (already done in jevoisbase):
# run the configure, enable V4L2 and select as default, disable all others
set(ARTK "${JVB}/Contrib/ARToolKit5arm/lib/SRC")
# In jevoisbase, we compile these files:
# cd Contrib/ARToolKit5arm/lib/SRC
# find . -name *.c | grep -v VideoLinuxV4L|grep -v 1394|grep -v Eden|grep -v Gl|grep -v examples|grep -v GStrea|grep -v calib|grep -v util|sed -e 's/\.\//\$\{ARTK\}\//g' | xargs
target_sources(jevoisbase PRIVATE ${ARTK}/ARMulti/arMultiGetTransMatStereo.c ${ARTK}/ARMulti/arMultiFreeConfig.c
${ARTK}/ARMulti/arMultiGetTransMat.c ${ARTK}/ARMulti/arMultiReadConfigFile.c ${ARTK}/VideoDummy/videoDummy.c
${ARTK}/AR2/coord.c ${ARTK}/AR2/marker.c ${ARTK}/AR2/matching.c ${ARTK}/AR2/tracking.c ${ARTK}/AR2/featureSet.c
${ARTK}/AR2/jpeg.c ${ARTK}/AR2/tracking2d.c ${ARTK}/AR2/selectTemplate.c ${ARTK}/AR2/featureMap.c ${ARTK}/AR2/handle.c
${ARTK}/AR2/imageSet.c ${ARTK}/AR2/matching2.c ${ARTK}/AR2/searchPoint.c ${ARTK}/AR2/template.c ${ARTK}/AR2/surface.c
${ARTK}/VideoImage/videoImage.c ${ARTK}/ARWrapper/trackingSub.c ${ARTK}/Video/video2.c ${ARTK}/Video/videoSaveImage.c
${ARTK}/Video/videoAspectRatio.c ${ARTK}/Video/video.c ${ARTK}/KPM/kpmFopen.c
${ARTK}/KPM/FreakMatcher/unsupported/test/mpreal/dlmalloc.c ${ARTK}/AR/arPattLoad.c ${ARTK}/AR/ar3DUtil.c
${ARTK}/AR/vHouse.c ${ARTK}/AR/paramDecomp.c ${ARTK}/AR/arImageProc.c ${ARTK}/AR/mSelfInv.c ${ARTK}/AR/arGetTransMat.c
${ARTK}/AR/paramDisp.c ${ARTK}/AR/mDisp.c ${ARTK}/AR/mUnit.c ${ARTK}/AR/paramClear.c ${ARTK}/AR/arDetectMarker2.c
${ARTK}/AR/mAlloc.c ${ARTK}/AR/mAllocInv.c ${ARTK}/AR/paramChangeSize.c ${ARTK}/AR/vTridiag.c
${ARTK}/AR/paramDistortion.c ${ARTK}/AR/mAllocTrans.c ${ARTK}/AR/mMul.c ${ARTK}/AR/mAllocMul.c
${ARTK}/AR/arPattAttach.c ${ARTK}/AR/vInnerP.c ${ARTK}/AR/vAlloc.c ${ARTK}/AR/arUtil.c ${ARTK}/AR/mAllocDup.c
${ARTK}/AR/ar3DCreateHandle.c ${ARTK}/AR/vFree.c ${ARTK}/AR/arGetTransMatStereo.c ${ARTK}/AR/mDup.c ${ARTK}/AR/mPCA.c
${ARTK}/AR/paramGetPerspective.c ${ARTK}/AR/vDisp.c ${ARTK}/AR/mDet.c ${ARTK}/AR/mAllocUnit.c ${ARTK}/AR/mTrans.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBZ.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWRCY.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWI3CA.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBI3CA.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBIYC.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWR3C565.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBI3CA5551.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWIA3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWIA3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBRYC.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWI3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBR3CA.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWICY.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWRA3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBR3CA4444.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWR3CA5551.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWR3C565.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWRCY.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBIA3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBI3C565.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWI3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWR3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBI3C565.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWI3C565.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWI3CA5551.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBI3CA.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBR3C565.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBRA3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWRC.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWRYC.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBR3C565.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBICY.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWI3CA4444.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBI3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBRC.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBI3CA5551.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWIYC.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWR3CA4444.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBZ.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWZ.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBR3CA5551.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWR3CA5551.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWIC.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWR3CA.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBRC.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBRCY.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWIYC.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWRC.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBIA3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBR3CA.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWRA3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWI3C565.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBR3CA4444.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBR3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWZ.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBI3CA4444.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWR3CA4444.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWICY.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBR3CA5551.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBI3CA4444.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBIC.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBIYC.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBRYC.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWR3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDWR3CA.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWI3CA5551.c
${ARTK}/AR/arLabelingSub/arLabelingSubEWI3CA4444.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWRYC.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBRA3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubEWIC.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBR3C.c ${ARTK}/AR/arLabelingSub/arLabelingSubDBI3C.c
${ARTK}/AR/arLabelingSub/arLabelingSubDBICY.c ${ARTK}/AR/arLabelingSub/arLabelingSubEBIC.c
${ARTK}/AR/arLabelingSub/arLabelingSubEBRCY.c ${ARTK}/AR/arLabelingSub/arLabelingSubDWI3CA.c ${ARTK}/AR/mFree.c
${ARTK}/AR/arPattSave.c ${ARTK}/AR/arLabeling.c ${ARTK}/AR/paramLT.c ${ARTK}/AR/arPattCreateHandle.c
${ARTK}/AR/arFilterTransMat.c ${ARTK}/AR/arGetMarkerInfo.c ${ARTK}/AR/arCreateHandle.c ${ARTK}/AR/arPattGetID.c
${ARTK}/AR/arGetLine.c ${ARTK}/AR/mInv.c ${ARTK}/AR/paramFile.c ${ARTK}/AR/arDetectMarker.c ${ARTK}/Util/thread_sub.c
${ARTK}/Util/profile.c ${ARTK}/ARICP/icpStereoPointRobust.c ${ARTK}/ARICP/icpStereoPoint.c ${ARTK}/ARICP/icpPoint.c
${ARTK}/ARICP/icpStereoHandle.c ${ARTK}/ARICP/icpCalibStereo.c ${ARTK}/ARICP/icpUtil.c ${ARTK}/ARICP/icpHandle.c
${ARTK}/ARICP/icpCore.c ${ARTK}/ARICP/icpPointRobust.c)
include_directories(Contrib/ARToolKit5arm/include)
########################################################################################################################
# tensorflow-lite support:
set(TFS "${JVB}/Contrib/tensorflow/tensorflow/contrib/lite")
# Note: see Makefile in Contrib/tensorflow/tensorflow/contrib/lite for any updates to this list of includes and list of
# source files for tensorflow lite.
include_directories("${JVB}/Contrib/tensorflow")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/flatbuffers/include")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/gemmlowp")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/neon_2_sse")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/eigen")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/farmhash/src")
include_directories("${JVB}/Contrib/tensorflow/tensorflow/contrib/lite/downloads/absl")
# in jevoisbase/Contrib/tensorflow/tensorflow/contrib/lite run:
# find . -name "*.cc" |grep -v test|grep -v python|grep -v bench|grep -v farmhash/dev|grep -v example|grep -v smartreply|grep -v absl|grep -v toco|grep -v grpc|grep -v java|grep -v profiling|grep -v registration|sed -e 's/\.\//\$\{TFS\}\//g' | xargs
#
# then add: ${TFS}/context.c
target_sources(jevoisbase PRIVATE ${TFS}/util.cc ${TFS}/schema/builtin_ops_header/generator.cc
${TFS}/schema/builtin_ops_header/generate.cc ${TFS}/simple_memory_arena.cc ${TFS}/tools/command_line_flags.cc
${TFS}/tools/verifier.cc ${TFS}/kernels/space_to_batch_nd.cc ${TFS}/kernels/mul.cc ${TFS}/kernels/div.cc
${TFS}/kernels/add.cc ${TFS}/kernels/unidirectional_sequence_rnn.cc ${TFS}/kernels/lstm.cc ${TFS}/kernels/register.cc
${TFS}/kernels/squeeze.cc ${TFS}/kernels/split.cc ${TFS}/kernels/resize_bilinear.cc
${TFS}/kernels/bidirectional_sequence_rnn.cc ${TFS}/kernels/skip_gram.cc ${TFS}/kernels/maximum_minimum.cc
${TFS}/kernels/slice.cc ${TFS}/kernels/exp.cc ${TFS}/kernels/unidirectional_sequence_lstm.cc
${TFS}/kernels/elementwise.cc ${TFS}/kernels/sparse_to_dense.cc ${TFS}/kernels/hashtable_lookup.cc
${TFS}/kernels/internal/reference/portable_tensor_utils.cc ${TFS}/kernels/internal/optimized/neon_tensor_utils.cc
${TFS}/kernels/internal/mfcc_mel_filterbank.cc ${TFS}/kernels/internal/mfcc_dct.cc
${TFS}/kernels/internal/quantization_util.cc ${TFS}/kernels/internal/kernel_utils.cc
${TFS}/kernels/internal/tensor_utils.cc ${TFS}/kernels/internal/spectrogram.cc ${TFS}/kernels/internal/mfcc.cc
${TFS}/kernels/floor.cc ${TFS}/kernels/space_to_depth.cc ${TFS}/kernels/concatenation.cc ${TFS}/kernels/cast.cc
${TFS}/kernels/pooling.cc ${TFS}/kernels/lsh_projection.cc ${TFS}/kernels/svdf.cc ${TFS}/kernels/mean.cc
${TFS}/kernels/transpose.cc ${TFS}/kernels/depthwise_conv.cc ${TFS}/kernels/strided_slice.cc ${TFS}/kernels/pad.cc
${TFS}/kernels/arg_max.cc ${TFS}/kernels/local_response_norm.cc ${TFS}/kernels/gather.cc
${TFS}/kernels/bidirectional_sequence_lstm.cc ${TFS}/kernels/kernel_util.cc ${TFS}/kernels/audio_spectrogram.cc
${TFS}/kernels/batch_to_space_nd.cc ${TFS}/kernels/embedding_lookup_sparse.cc ${TFS}/kernels/embedding_lookup.cc
${TFS}/kernels/select.cc ${TFS}/kernels/topk_v2.cc ${TFS}/kernels/fully_connected.cc ${TFS}/kernels/gemm_support.cc
${TFS}/kernels/sub.cc ${TFS}/kernels/neg.cc ${TFS}/kernels/comparisons.cc ${TFS}/kernels/dequantize.cc
${TFS}/kernels/l2norm.cc ${TFS}/kernels/basic_rnn.cc ${TFS}/kernels/mfcc.cc ${TFS}/kernels/reshape.cc
${TFS}/kernels/eigen_support.cc ${TFS}/kernels/transpose_conv.cc ${TFS}/kernels/activations.cc ${TFS}/kernels/conv.cc
${TFS}/string_util.cc ${TFS}/downloads/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc
${TFS}/downloads/farmhash/src/farmhash.cc ${TFS}/model.cc ${TFS}/op_resolver.cc ${TFS}/graph_info.cc
${TFS}/error_reporter.cc ${TFS}/interpreter.cc ${TFS}/optional_debug_tools.cc ${TFS}/nnapi_delegate.cc
${TFS}/allocation.cc ${TFS}/arena_planner.cc ${TFS}/context.c)
########################################################################################################################
# Link to OpenCV libraries for superpixels, aruco, and others:
# From this: ls /usr/share/jevois-opencv-4.*/lib/|grep ".so$"|sed -e s/.so//|sed -e s/^lib//|xargs
target_link_libraries(jevoisbase ${JEVOIS_OPENCV_LIBS} opencv_aruco opencv_bgsegm opencv_bioinspired opencv_calib3d
opencv_ccalib opencv_core opencv_datasets opencv_dnn_objdetect opencv_dnn opencv_dpm opencv_face opencv_features2d
opencv_flann opencv_fuzzy opencv_gapi opencv_hfs opencv_imgcodecs opencv_img_hash opencv_imgproc
opencv_line_descriptor opencv_ml opencv_objdetect opencv_optflow opencv_phase_unwrapping opencv_photo opencv_plot
opencv_quality opencv_reg opencv_saliency opencv_shape opencv_stereo opencv_stitching opencv_structured_light
opencv_superres opencv_surface_matching opencv_text opencv_tracking opencv_videoio opencv_video opencv_videostab
opencv_xfeatures2d opencv_ximgproc opencv_xobjdetect opencv_xphoto)
# removed: opencv_freetype (not available on platform), opencv_highgui (not needed), opencv_rgbd (not needed)
########################################################################################################################
# Install shared resources (cascade classifiers, neural network weights, etc):
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/share"
DESTINATION "${JEVOIS_INSTALL_ROOT}" COMPONENT bin)
########################################################################################################################
# Documentation:
add_custom_target(doc COMMAND doxygen "${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen.cfg"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# This is to install the doc of jevois and jevoisbase to jevois.org, only works in ilab:
if ($ENV{JEVOIS_ILAB})
add_custom_target(docweb
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/docinstall.sh
DEPENDS doc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif ($ENV{JEVOIS_ILAB})
# Documentation files for our install / distribution package
set(DOC_FILES README INSTALL COPYING)
if (JEVOIS_PLATFORM)
set(DOC_PATH "share/doc/jevoisbase-platform")
else (JEVOIS_PLATFORM)
set(DOC_PATH "share/doc/jevoisbase-host")
endif (JEVOIS_PLATFORM)
install(FILES ${DOC_FILES} DESTINATION ${DOC_PATH} COMPONENT bin)
########################################################################################################################
# Debian packaging:
# Create packages (Debian, RPM): in hbuild/ or pbuild/, just type 'sudo cpack' to create the package.
# To list the files created in a package, run: dpkg --contents <package.deb>
set(CPACK_PACKAGE_DESCRIPTION "JeVois Smart Machine Vision Base Modules")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "JeVois Smart Embedded Machine Vision Toolkit, Base Modules")
set(CPACK_PACKAGE_CONTACT "Laurent Itti <jevois.org@gmail.com>")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
set(CPACK_DEBIAN_PACKAGE_SECTION "universe")
set(CPACK_PACKAGE_VENDOR "iLab at the University of Southern California")
set(CPACK_PACKAGE_VERSION_MAJOR "${JEVOIS_VERSION_MAJOR}") # Note: jevoisbase version tracks jevois version
set(CPACK_PACKAGE_VERSION_MINOR "${JEVOIS_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${JEVOIS_VERSION_PATCH}")
set(JEVOIS_PACKAGE_RELEASE "1") # packager revision number
if (JEVOIS_PLATFORM)
set(JEVOIS_DEPEND "jevois-platform (>=${JEVOIS_VERSION_MAJOR}.${JEVOIS_VERSION_MINOR}.${JEVOIS_VERSION_PATCH})")
else (JEVOIS_PLATFORM)
set(JEVOIS_DEPEND "jevois-host (>=${JEVOIS_VERSION_MAJOR}.${JEVOIS_VERSION_MINOR}.${JEVOIS_VERSION_PATCH})")
endif (JEVOIS_PLATFORM)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${JEVOIS_DEPEND}, libgles2-mesa, libgles2-mesa-dev, curl, libdmtx-dev, python3-scipy")
# Use helper from JeVois.cmake for all other settings:
jevois_setup_cpack("jevoisbase")
########################################################################################################################
# Wrapping up:
jevois_project_finalize() # call this last in your CMakeLists.txt, will un-mount the live microSD if applicable