project('spine', 'd',
  license: 'AGPL-3',
  version: '0.16.0',
  meson_version: '>=0.46'
)
#if meson.get_compiler('d').get_id() == 'gcc'
#    error('spine cannot be compiled with GDC at time. Sorry.')
#endif
spine_src = [
  'src/sisudoc/spine.d',
  'src/sisudoc/conf/compile_time_info.d',
  'src/sisudoc/io_in/paths_source.d',
  'src/sisudoc/io_in/read_config_files.d',
  'src/sisudoc/io_in/read_source_files.d',
  'src/sisudoc/io_out/cgi_sqlite_search_form.d',
  'src/sisudoc/io_out/create_zip_file.d',
  'src/sisudoc/io_out/defaults.d',
  'src/sisudoc/io_out/epub3.d',
  'src/sisudoc/io_out/html.d',
  'src/sisudoc/io_out/hub.d',
  'src/sisudoc/io_out/latex.d',
  'src/sisudoc/io_out/metadata.d',
  'src/sisudoc/io_out/odt.d',
  'src/sisudoc/io_out/package.d',
  'src/sisudoc/io_out/paths_output.d',
  'src/sisudoc/io_out/rgx.d',
  'src/sisudoc/io_out/source_pod.d',
  'src/sisudoc/io_out/sqlite.d',
  'src/sisudoc/io_out/xmls_css.d',
  'src/sisudoc/io_out/xmls.d',
  'src/sisudoc/meta/conf_make_meta_json.d',
  'src/sisudoc/meta/conf_make_meta_structs.d',
  'src/sisudoc/meta/conf_make_meta_yaml.d',
  'src/sisudoc/meta/defaults.d',
  'src/sisudoc/meta/doc_debugs.d',
  'src/sisudoc/meta/metadoc.d',
  'src/sisudoc/meta/metadoc_from_src.d',
  'src/sisudoc/meta/metadoc_curate.d',
  'src/sisudoc/meta/metadoc_curate_authors.d',
  'src/sisudoc/meta/metadoc_curate_topics.d',
  'src/sisudoc/meta/metadoc_object_setter.d',
  'src/sisudoc/meta/metadoc_show_config.d',
  'src/sisudoc/meta/metadoc_show_make.d',
  'src/sisudoc/meta/metadoc_show_metadata.d',
  'src/sisudoc/meta/metadoc_show_summary.d',
  'src/sisudoc/meta/package.d',
  'src/sisudoc/meta/rgx.d',
  'src/sisudoc/share/defaults.d',
]
source_root = meson.source_root()
src_dir = include_directories('src/')
# Dependencies
dep_tinyendian   = dependency('tinyendian',   version: '>= 0.2.0',  fallback: ['tinyendian',   'tinyendian_dep'],   method: 'dub')
dep_dyaml        = dependency('dyaml',        version: '>= 0.8.3',  fallback: ['dyaml',        'dyaml_dep'],        method: 'dub')
dep_d2sqlite3    = dependency('d2sqlite3',    version: '>= 0.19.1', fallback: ['d2sqlite3',    'd2sqlite3_dep'],    method: 'dub')
dep_imageformats = dependency('imageformats', version: '>= 7.0.2',  fallback: ['imageformats', 'imageformats_dep'], method: 'dub')
# Executable
spine_exe = executable('spine',
  [spine_src],
  include_directories : [src_dir],
  d_import_dirs: [include_directories('views')],
  dependencies : [
    dep_tinyendian,
    dep_dyaml,
    dep_d2sqlite3,
    dep_imageformats,
  ],
  install : true
)