-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
119 lines (102 loc) · 3.58 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
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
project('thermocam-pcb', ['cpp'],
default_options : [ 'cpp_std=c++17' ]
)
cxx = meson.get_compiler('cpp')
# Get rid of some warnings from WIC SDK and Crow
add_global_arguments('-Wno-unknown-pragmas', '-Wno-non-virtual-dtor', language : 'cpp')
if cxx.has_header('wic/wic.h', args : '-I@0@/include'.format(get_option('wic_home')))
if cxx.has_header('EbVersion.h', args : '-I@0@/include'.format(get_option('ebus_home')))
libs = []
foreach lib : 'PvBase PvDevice PvBuffer PvGenICam PvTransmitter PvVirtualDevice PvAppUtils PvPersistence PvSerial PvStream PvSystem'.split()
libs += cxx.find_library(lib, dirs : '@0@/lib'.format(get_option('ebus_home')))
endforeach
ebus_dep = declare_dependency(
include_directories : include_directories(get_option('ebus_home') / 'include'),
compile_args : [ '-D_UNIX_', '-D_LINUX_' ],
dependencies : libs,
link_args : [
'-Wl,-rpath=@0@/lib/genicam/bin/Linux64_x64'.format(get_option('ebus_home')),
]
)
else
error('eBUS SDK not found in @0@. Run meson -Debus_home=...'.format(get_option('ebus_home')))
endif
wic_dep = declare_dependency(
include_directories : include_directories(get_option('wic_home') / 'include'),
dependencies : [
cxx.find_library('WIC', dirs : '@0@/lib'.format(get_option('wic_home'))),
ebus_dep,
dependency('tbb'),
],
compile_args : [ '-DWITH_WIC_SDK' ],
)
else
warning('WIC SDK not found in @0@. To compile with WIC camera support, run meson -Dwic_home=...'.format(get_option('wic_home')))
wic_dep = declare_dependency() # empty
endif
opencv_dep = dependency('opencv4', required : true)
version_h = vcs_tag(input : 'version.h.in', output : 'version.h',
command : get_option('version') != ''
? ['echo', get_option('version')]
: ['git', 'describe', '--always'])
file2cpp = generator(find_program('file2cpp'),
output : ['@[email protected]', '@[email protected]'],
arguments : [ '@INPUT@', '@OUTPUT0@', '@OUTPUT1@' ],
)
webserver = static_library('webserver',
[
'webserver.cpp',
file2cpp.process('index.html', 'script.js'),
],
dependencies: [
opencv_dep,
dependency('nlohmann_json'),
dependency('boost', modules : ['system']),
dependency('zlib'),
dependency('threads')
],
)
executable('thermocam-pcb',
[
'thermocam-pcb.cpp',
'point-tracking.cpp',
'img_stream.cpp',
'thermo_img.cpp',
'arg-parse.cpp',
version_h
],
dependencies: [
opencv_dep,
wic_dep,
dependency('libsystemd'),
],
link_with : webserver,
install : true,
)
executable('track-test', ['support/track-test.cpp'],
dependencies: [
opencv_dep,
dependency('openmp')
],
)
conf_data = configuration_data()
conf_data.set('EBUS_HOME', get_option('ebus_home'))
conf_data.set('WIC_HOME', get_option('wic_home'))
conf_data.set('OPENCV_HOME', opencv_dep.get_pkgconfig_variable('prefix'))
conf_data.set('PREFIX', get_option('prefix'))
conf_data.set('DATADIR', get_option('datadir'))
configure_file(input : 'run.in',
output : 'run',
configuration : conf_data,
install_dir : 'bin'
)
configure_file(input : 'thermocam-pcb.service.in',
output : 'thermocam-pcb.service',
configuration : conf_data,
install_dir : 'lib/systemd'
)
configure_file(input : 'config.h.in',
output : 'config.h',
configuration : conf_data,
)
install_data('DejaVuSans.ttf')