1if cpp.has_header('CLI/CLI.hpp')
2    CLI11_dep = declare_dependency()
3else
4    CLI11_dep = dependency('CLI11')
5endif
6
7sdeventplus_dep = dependency('sdeventplus')
8
9source = [
10    'usb_manager_main.cpp',
11    'usb_manager.cpp',
12    '../utils.cpp',
13    ]
14
15executable(
16    'phosphor-usb-code-update',
17    source,
18    include_directories: ['..'],
19    dependencies: [
20        CLI11_dep,
21        phosphor_logging_dep,
22        sdbusplus_dep,
23        sdeventplus_dep,
24    ],
25    install: true,
26    install_dir: get_option('bindir')
27)
28
29systemd_system_unit_dir = dependency('systemd').get_variable(
30    'systemdsystemunitdir',
31    pkgconfig_define: ['prefix', get_option('prefix')])
32udev_dir = dependency('udev').get_variable(
33    'udev_dir',
34    pkgconfig_define: ['prefix', get_option('prefix')])
35
36install_data(
37    'services/usb-code-update@.service',
38    install_dir: systemd_system_unit_dir
39)
40
41install_data(
42    '70-bmc-usb.rules',
43    install_dir: udev_dir / 'rules.d'
44)
45