forked from ivaroli/DiscoCameraController
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
83 lines (73 loc) · 2.48 KB
/
meson.build
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
project('camera_controller', 'c', 'cpp', subproject_dir: 'lib', default_options: [
'buildtype=debug',
'c_std=gnu11',
'b_lto=false',
'default_library=static',
'csp:packet_padding_bytes=42',
'csp:buffer_count=1000',
'csp:buffer_size=2048',
'csp:conn_max=20',
'csp:conn_rxqueue_len=1000',
'csp:qfifo_len=1000',
'csp:rdp_max_window=1000',
'csp:port_max_bind=16',
'csp:use_rtable=true',
'param:have_fopen=true',
'param:collector=false',
'param:list_dynamic=true'
])
add_global_arguments('-I../include', language: 'c')
sources = files([
'src/main.cpp',
'src/message_queue/message_queue.cpp',
'src/message_queue/metadata.pb.cpp',
'src/camera_control/vimba_controller.cpp',
'src/camera_control/test_controller.cpp',
'src/camera_control/ir_controller.cpp',
'src/camera_control/capture_controller.cpp',
'src/communication/csp_server.c',
'src/communication/param_config.c',
'src/communication/serial.c',
'src/communication/vmem_config.c',
])
cpp = meson.get_compiler('cpp')
csp_dep = dependency('csp', fallback: ['csp', 'csp_dep'])
param_dep = dependency('param', fallback: ['param', 'param_dep'])
proto_dep = dependency('protobuf', fallback: ['libprotobuf', 'proto_c_dep'])
opencv_dep = dependency('opencv4')
deps = [csp_dep,param_dep,opencv_dep,proto_dep]
dirs = []
dirs += include_directories(
'include/message_queue',
'include/utils',
'include/camera_control',
'include/communication',
)
if meson.is_cross_build()
message('Compiling for aarch64')
vmb_dep = cpp.find_library('VmbCPP', dirs: join_paths(meson.source_root(),'lib/VimbaX_2023-4-ARM64/api/lib'))
deps += [vmb_dep]
dirs += include_directories('lib/VimbaX_2023-4-ARM64/api/include')
else
message('Native build')
vmb_dep = cpp.find_library('VmbCPP', dirs: join_paths(meson.source_root(),'lib/VimbaX_2023-4-Linux/api/lib'))
deps += [vmb_dep]
dirs += include_directories('lib/VimbaX_2023-4-Linux/api/include')
endif
executable('Disco2CameraControl', sources,
include_directories : dirs,
dependencies : deps,
install : true,
link_args : ['-Wl,--export-dynamic', '-ldl'],
)
# Test code
sources_tst = files([
'src/message_queue/metadata.pb.cpp',
'test_code/receiver.cpp'
])
executable('receiver', sources_tst,
include_directories : dirs,
dependencies : deps,
install : true,
link_args : ['-Wl,--export-dynamic', '-ldl'],
)