project(
'c8-photos',
'c',
version: '0.1.0',
license: 'CC0-1.0',
meson_version: '>=1.3.0',
default_options: ['c_std=c11', 'warning_level=2', 'buildtype=debugoptimized', 'werror=false'],
)
add_project_arguments(
'-D_POSIX_C_SOURCE=200809L',
'-D_GNU_SOURCE',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
language: 'c',
)
app_id = 'org.cont8nuum.Photos'
# Rotating (written as the EXIF orientation, so nothing is re-encoded)
# and the camera's details need gexiv2
gexiv2 = dependency('gexiv2-0.16', required: get_option('metadata'))
conf = configuration_data()
conf.set10('HAVE_GEXIV2', gexiv2.found())
configure_file(output: 'config.h', configuration: conf)
executable('c8-photos',
files('src/main.c', 'src/viewer.c', 'src/picture.c', 'src/folder.c',
'src/encode.c',
'src/browse.c', 'src/meta.c', 'src/prefs.c'),
dependencies: [
dependency('c8ui'),
dependency('c8-base'), # stealth.h
dependency('glib-2.0'),
dependency('gio-2.0'),
dependency('glycin-2'),
dependency('xkbcommon'),
gexiv2,
meson.get_compiler('c').find_library('m'),
],
install: true,
)
# The live tile: the newest pictures, while the app isn't open
executable('c8-photos-tile',
files('src/tile.c', 'src/encode.c'),
dependencies: [
dependency('c8-base'), # tiles.h
dependency('glib-2.0'),
dependency('gio-2.0'),
dependency('glycin-2'),
dependency('cairo'),
meson.get_compiler('c').find_library('m'),
],
install: true,
)
install_data('data/c8-photos.widget',
install_dir: get_option('datadir') / 'cont8nuum/widgets')
desktop = configure_file(
input: 'data' / app_id + '.desktop.in',
output: app_id + '.desktop',
configuration: {'bindir': get_option('prefix') / get_option('bindir')},
)
install_data(desktop, install_dir: get_option('datadir') / 'applications')
install_data('data' / app_id + '.svg',
install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps')
gnome = import('gnome')
gnome.post_install(update_desktop_database: true)