stdprop_sources = [
    'properties.c',
    'properties.h',
    'propdesc.c',
    'proplist.c',
    'propoffsets.c',
    'propobject.c',
    'prop_basic.c',
    'prop_basic.h',
    'prop_dict.c',
    'prop_dict.h',
    'prop_matrix.c',
    'prop_matrix.h',
    'prop_pattern.c',
    'prop_pattern.h',
    'prop_pixbuf.c',
    'prop_pixbuf.h',
    'prop_inttypes.c',
    'prop_inttypes.h',
    'prop_geomtypes.c',
    'prop_geomtypes.h',
    'prop_attr.c',
    'prop_attr.h',
    'prop_text.c',
    'prop_text.h',
    'prop_widgets.c',
    'prop_widgets.h',
    'prop_sdarray.c',
    'prop_sdarray.h',
    'prop_sdarray_widget.c',
    'prop_sdarray_widget.h',
    'propdialogs.c',
    'propregistry.c',
]

libdia_sources = stdprop_sources + [
    'diagramdata.c',
    'diagramdata.h',
    'layer.c',
    'dia-layer.h',
    'geometry.c',
    'geometry.h',
    'color.c',
    'color.h',
    'dia_xml.c',
    'dia_xml.c',
    'attributes.c',
    'attributes.h',
    'text.c',
    'text.h',
    'textline.c',
    'textline.h',
    'font.c',
    'font.h',
    'group.c',
    'group.h',
    'utils.c',
    'utils.h',
    'arrows.c',
    'arrows.h',
    'message.c',
    'message.h',
    'focus.c',
    'focus.h',
    'sheet.c',
    'sheet.h',
    'connectionpoint.c',
    'connectionpoint.h',
    'object.c',
    'object.h',
    'object-alias.c',
    'object-alias.h',
    'object_defaults.c',
    'connection.c',
    'connection.h',
    'orth_conn.c',
    'orth_conn.h',
    'poly_conn.c',
    'poly_conn.h',
    'bezier_conn.c',
    'bezier_conn.h',
    'bezier-common.c',
    'bezier-common.h',
    'element.c',
    'element.h',
    'polyshape.c',
    'polyshape.h',
    'beziershape.c',
    'beziershape.h',
    'dia-change.c',
    'dia-change.h',
    'dia-object-change.c',
    'dia-object-change.h',
    'dia-state-object-change.c',
    'dia-state-object-change.h',
    'dia-object-change-list.c',
    'dia-object-change-list.h',
    'dialogs.c',
    'dialogs.h',
    'widgets.c',
    'widgets.h',
    'diaoptionmenu.c',
    'diaoptionmenu.h',
    'units.c',
    'units.h',
    'dia_image.c',
    'dia_image.c',
    'pattern.c',
    'pattern.h',
    'standard-path.c',
    'standard-path.h',
    'intl.c',
    'intl.h',
    'filter.c',
    'filter.h',
    'connpoint_line.c',
    'connpoint_line.h',
    'dia_dirs.c',
    'dia_dirs.h',
    'plug-ins.c',
    'plug-ins.h',
    'paper.c',
    'paper.h',
    'boundingbox.c',
    'boundingbox.h',
    'dynamic_obj.c',
    'create.c',
    'diatransform.c',
    'diarenderer.c',
    'diaimportrenderer.c',
    'diainteractiverenderer.c',
    'diainteractiverenderer.h',
    'renderer/diacairo.c',
    'renderer/diacairo-renderer.c',
    'renderer/diacairo-interactive.c',
    'renderer/diacairo-print.c',
    'diapathrenderer.c',
    'path-math.c',
    'diapatternselector.c',
    'diatransformrenderer.c',
    'diasvgrenderer.c',
    'dia_svg.c',
    'autoroute.c',
    'parent.c',
    'dia-autoptr.h',
    'dia-arrow-cell-renderer.c',
    'dia-arrow-cell-renderer.h',
    'dia-arrow-chooser.c',
    'dia-arrow-chooser.h',
    'dia-arrow-selector.c',
    'dia-arrow-selector.h',
    'dia-arrow-preview.c',
    'dia-arrow-preview.h',
    'dia-colour-cell-renderer.c',
    'dia-colour-cell-renderer.h',
    'dia-colour-selector.c',
    'dia-colour-selector.h',
    'dia-file-selector.c',
    'dia-file-selector.h',
    'dia-font-selector.c',
    'dia-font-selector.h',
    'dia-graphene.h',
    'dia-guide.c',
    'dia-guide.h',
    'dia-handle.c',
    'dia-line-cell-renderer.c',
    'dia-line-cell-renderer.h',
    'dia-line-chooser.c',
    'dia-line-chooser.h',
    'dia-line-style-selector.c',
    'dia-line-style-selector.h',
    'dia-line-preview.c',
    'dia-line-preview.h',
    'dia-simple-list.c',
    'dia-simple-list.h',
    'dia-size-selector.c',
    'dia-size-selector.h',
    'dia-unit-spinner.c',
    'dia-unit-spinner.h',
    'persistence.c',
    'diaerror.c',
    'debug.c',
    'prefs.c',
    'dialib.c',
    'diacontext.c',
    'diacellrendererenum.c',
    'handle.h',
]

gnome = import('gnome')

libdia_sources += gnome.mkenums_simple('dia-lib-enums',
                                   sources: [
                                                 'dia-enums.h',
                                                 'font.h',
                                                 'units.h',
                                            ]
)

diamarshal = gnome.genmarshal(
    'diamarshal',
    prefix: 'dia_marshal',
    sources: 'diamarshal.list',
)

# TODO: This is used in app/, should we install / do anything else with it?
diamarshal_h = diamarshal[1]

resources = gnome.compile_resources('libdia-resources', 'libdia.gresource.xml',
                                    source_dir : '.',
                                    c_name : 'libdia')

libdia_deps = [
    libc_dep,
    libgtk_dep,
    libglib_dep,
    libxml_dep,
    libm_dep,
    libzlib_dep,
    gmodule_dep,
    graphene_dep,
]

libdia_inc = include_directories('.')

libdia_lib = library('dia',
    libdia_sources + [diamarshal, resources, config_h],
    dependencies: libdia_deps,
    include_directories: configuration_inc,
    c_args: ['-Wall', '-DLIBDIA_COMPILATION'],
    vs_module_defs: 'libdia.def',
    install: true,
)

libdia_dep = declare_dependency (include_directories: libdia_inc,
                                 link_with: libdia_lib,
                                 dependencies: libdia_deps)
