summaryrefslogtreecommitdiff
path: root/src/libcamera/meson.build
blob: 2447695e1ee0e97d22fc0b010bb05f2239f529b1 (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
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
libcamera_sources = files([
    'buffer.cpp',
    'camera.cpp',
    'camera_manager.cpp',
    'camera_sensor.cpp',
    'controls.cpp',
    'device_enumerator.cpp',
    'device_enumerator_sysfs.cpp',
    'event_dispatcher.cpp',
    'event_dispatcher_poll.cpp',
    'event_notifier.cpp',
    'formats.cpp',
    'geometry.cpp',
    'ipa_interface.cpp',
    'ipa_manager.cpp',
    'ipa_module.cpp',
    'ipa_proxy.cpp',
    'ipc_unixsocket.cpp',
    'log.cpp',
    'media_device.cpp',
    'media_object.cpp',
    'message.cpp',
    'object.cpp',
    'pipeline_handler.cpp',
    'process.cpp',
    'request.cpp',
    'signal.cpp',
    'stream.cpp',
    'thread.cpp',
    'timer.cpp',
    'utils.cpp',
    'v4l2_controls.cpp',
    'v4l2_device.cpp',
    'v4l2_subdevice.cpp',
    'v4l2_videodevice.cpp',
])

libcamera_headers = files([
    'include/camera_sensor.h',
    'include/device_enumerator.h',
    'include/device_enumerator_sysfs.h',
    'include/device_enumerator_udev.h',
    'include/event_dispatcher_poll.h',
    'include/formats.h',
    'include/ipa_manager.h',
    'include/ipa_module.h',
    'include/ipa_proxy.h',
    'include/ipc_unixsocket.h',
    'include/log.h',
    'include/media_device.h',
    'include/media_object.h',
    'include/message.h',
    'include/pipeline_handler.h',
    'include/process.h',
    'include/thread.h',
    'include/utils.h',
    'include/v4l2_device.h',
    'include/v4l2_subdevice.h',
    'include/v4l2_videodevice.h',
])

libcamera_internal_includes =  include_directories('include')

includes = [
    libcamera_includes,
    libcamera_internal_includes,
]

subdir('pipeline')

proxy_install_dir = join_paths(get_option('libdir'), 'libcamera', 'proxy')
config_h.set('IPA_PROXY_DIR',
             '"' + join_paths(get_option('prefix'), proxy_install_dir) + '"')

libudev = dependency('libudev', required : false)

if libudev.found()
    config_h.set('HAVE_LIBUDEV', 1)
    libcamera_sources += files([
        'device_enumerator_udev.cpp',
    ])
endif

gen_controls = files('gen-controls.awk')

control_types_cpp = custom_target('control_types_cpp',
                                  input : files('controls.cpp'),
                                  output : 'control_types.cpp',
                                  depend_files : gen_controls,
                                  command : [gen_controls, '@INPUT@', '--code', '@OUTPUT@'])

libcamera_sources += control_types_cpp

gen_version = join_paths(meson.source_root(), 'utils', 'gen-version.sh')

version_cpp = vcs_tag(command : [gen_version, meson.build_root()],
                      input : 'version.cpp.in',
                      output : 'version.cpp',
                      fallback : meson.project_version())

libcamera_sources += version_cpp

libcamera_deps = [
    cc.find_library('dl'),
    libudev,
    dependency('threads'),
]

libcamera = shared_library('camera',
                           libcamera_sources,
                           install : true,
                           include_directories : includes,
                           dependencies : libcamera_deps)

libcamera_dep = declare_dependency(sources : [libcamera_api, libcamera_h],
                                   include_directories : libcamera_includes,
                                   link_with : libcamera)