project('Gemtext2HTML', ['objc', 'c'],
  version: '1.0.1',
  meson_version: '>=1.5.0',
  default_options: {
    'optimization': '2'
  })

objfw_dep = dependency('objfw')
objfw_test_dep = dependency('objfw', modules: ['ObjFWTest'])

objfwconfig = find_program('objfw-config')
packages_dir = run_command(
  [objfwconfig, '--packages-dir'],
  check: true).stdout().strip()

incdir = include_directories('lib')
readme = files('README.gmi')

subdir('lib')
subdir('cmd')
subdir('tests')

configure_file(
  input: 'Gemtext2HTML.oc.in',
  output: 'Gemtext2HTML.oc',
  configuration: {
    'includedir': get_option('prefix') / get_option('includedir'),
    'libdir': get_option('prefix') / get_option('libdir'),
  },
  install: true,
  install_dir: packages_dir)
