File: meson.build

package info (click to toggle)
megapixels 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,876 kB
  • sloc: ansic: 6,530; python: 442; xml: 367; sh: 116; makefile: 3
file content (141 lines) | stat: -rw-r--r-- 3,712 bytes parent folder | download | duplicates (2)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
project('megapixels', 'c', version: '2.0.0')

gnome = import('gnome')
gtkdep = dependency('gtk4')
libfeedback = dependency('libfeedback-0.0')
zbar = dependency('zbar')
jpeg = dependency('libjpeg')
threads = dependency('threads')
# gl = dependency('gl')
epoxy      = dependency('epoxy')

libmp = dependency('libmegapixels', version: '>=1.0.0')
libdng = dependency('libdng', version: '>=1.1.0')

# We only build in support for Wayland/X11 if GTK did so
optdeps = []
if dependency('gtk4-wayland', required: false).found()
  optdeps += dependency('gtk4-wayland')
  optdeps += dependency('wayland-client')
endif
if dependency('x11', required: false).found()
  optdeps += dependency('gtk4-x11')
  optdeps += dependency('x11')
  optdeps += dependency('xrandr')
endif

cc = meson.get_compiler('c')
libm = cc.find_library('m', required: false)

subdir('data')

conf = configuration_data()
conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir')))
conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
configure_file(
  output: 'config.h',
  configuration: conf)

add_global_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'c')

# Define DEBUG for debug builds only (debugoptimized is not included on this one)
if get_option('buildtype') == 'debug'
  add_global_arguments('-DDEBUG', language: 'c')
endif

executable('megapixels',
  'src/camera.c',
  'src/flash.c',
  'src/gl_util.c',
  'src/gles2_debayer.c',
  'src/ini.c',
  'src/io_pipeline.c',
  'src/main.c',
  'src/matrix.c',
  'src/pipeline.c',
  'src/process_pipeline.c',
  'src/rotation.c',
  'src/zbar_pipeline.c',
  'src/dcp.c',
  resources,
  include_directories: 'src/',
  dependencies: [gtkdep, libfeedback, libm, zbar, threads, epoxy, libmp, libdng, jpeg] + optdeps,
  install: true,
  link_args: '-Wl,-ldl')

executable('movie_audio_rec',
  'movie_audio_rec.c',
  dependencies: [ dependency('libpulse-simple') ],
  install : true,
  install_dir: get_option('libexecdir') / 'megapixels/',
)

install_data(
  [
    'mpegize.py'
  ],
  install_dir: get_option('libexecdir') / 'megapixels/',
)

configure_file(
  input: 'movie.sh.in',
  output: 'movie.sh',
  configuration: {'LIBEXECDIR': join_paths(get_option('prefix'), get_option('libexecdir')) / 'megapixels/'},
  install_dir: get_option('datadir') / 'megapixels/',
  install_mode: 'rwxr-xr-x',
)

install_data(
  [
    'config/pine64,pinephone,rear.dcp',
    'config/pine64,pinephone,front.dcp',
  ],
  install_dir: get_option('datadir') / 'megapixels/config/')

# Formatting
clang_format = find_program('clang-format-14', required: false)
if clang_format.found()
  format_files = [
    'data/blit.frag',
    'data/blit.vert',
    'data/debayer.frag',
    'data/debayer.vert',
    'data/debayer_packed.frag',
    'data/solid.frag',
    'data/solid.vert',
    'src/camera.c',
    'src/camera.h',
    'src/camera_config.c',
    'src/camera_config.h',
    'src/device.c',
    'src/device.h',
    'src/flash.c',
    'src/flash.h',
    'src/gl_util.c',
    'src/gl_util.h',
    'src/gles2_debayer.c',
    'src/gles2_debayer.h',
    'src/io_pipeline.c',
    'src/io_pipeline.h',
    'src/main.c',
    'src/main.h',
    'src/matrix.c',
    'src/matrix.h',
    'src/mode.c',
    'src/mode.h',
    'src/pipeline.c',
    'src/pipeline.h',
    'src/process_pipeline.c',
    'src/process_pipeline.h',
    'src/rotation.c',
    'src/rotation.h',
    'src/zbar_pipeline.c',
    'src/zbar_pipeline.h',
    'tools/camera_test.c',
    'tools/list_devices.c',
  ]
  run_target('clang-format',
             command: ['clang-format.sh', '-i'] + format_files)
  run_target('clang-format-check',
             command: ['clang-format.sh', '-n', '-Werror'] + format_files)
endif