aboutsummaryrefslogtreecommitdiff
path: root/subprojects/plugin_hostlist/meson.build
blob: d8286d1a462a6916757f8b328d95aa5040bb2f00 (plain)
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
project('hostlistfilter', 'cpp')

mod_qt5 = import('qt5')
dep_qt5 = dependency('qt5',
  modules: [ 'Core', 'Network', 'WebEngineWidgets' ],
  include_type: 'system'
)
dep_catch = dependency('catch2', required: true, fallback: ['catch2', 'catch2_dep'] )

smolbote_interface = include_directories(get_option('interface')) 
message(get_option('interface'))

lib_hostlistfilter = static_library('hostlistfilter',
  [ 'filterlist.cpp' ],
  include_directories: smolbote_interface,
  dependencies: [dep_qt5]
)

dep_hostlistfilter = declare_dependency(
  include_directories: [ '.', smolbote_interface ],
  link_with: lib_hostlistfilter
)

# plugin
plugin = shared_library('smolblokHostlistPlugin',
  [ 'plugin/plugin.cpp',
    mod_qt5.preprocess(include_directories: smolbote_interface, moc_headers: 'plugin/plugin.h', dependencies: dep_qt5) ],
  include_directories: smolbote_interface,
  dependencies: [ dep_hostlistfilter, dep_qt5 ],
  install: true,
  install_dir: get_option('libdir')/'smolbote/plugins'
)

# tests
test('rule parsing', executable('rule', 
  sources: 'test/rule.cpp',
  dependencies: [dep_qt5, dep_catch, dep_hostlistfilter]))

test('filterlist', executable('filterlist',
  sources: 'test/filterlist.cpp',
  dependencies: [dep_qt5, dep_catch, dep_hostlistfilter]),
  env: 'HOSTLIST_TXT='+meson.current_source_dir()/'test/hostlist.txt'
)