## Copyright (c) 2009  Openismus GmbH  <http://www.openismus.com/>
##
## This file is part of Glom.
##
## Glom is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published
## by the Free Software Foundation, either version 2 of the License,
## or (at your option) any later version.
##
## Glom is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
## See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.


# The location of the gettext catalogs as defined by intltool.
glom_localedir = @localedir@

#Let gimpruler build without changing the paths in its source code:
glom_includes += -I$(top_srcdir)/glom/utility_widgets/gimpruler



bin_PROGRAMS += glom/glom

glom_glom_CPPFLAGS = $(glom_includes) $(GLOM_CFLAGS) $(PYTHON_CPPFLAGS) $(BOOST_PYTHON_CFLAGS) $(GCOV_CFLAGS) $(glom_defines)

# Generate the GResource source file for .glade and icons files:
# TODO: Do not use all .glade files in the client-only build.
glom_resource_file = $(srcdir)/data/glom.gresource.xml
BUILT_SOURCES += data/glom-resources.c
data/glom-resources.c: $(glom_resource_file) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(glom_resource_file))
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --internal --target=$@ --sourcedir=$(srcdir) --generate-source $(glom_resource_file)

# Generate the GResource source file for example .glom files:
glom_examples_resource_file = $(srcdir)/examples/glom-examples.gresource.xml
BUILT_SOURCES += examples/glom-examples-resources.c
examples/glom-examples-resources.c: $(glom_examples_resource_file) $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --generate-dependencies $(glom_examples_resource_file))
	$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --internal --target=$@ --sourcedir=$(srcdir) --generate-source $(glom_examples_resource_file)

EXTRA_DIST += \
	$(glom_resource_file) \
	$(glom_examples_resource_file)


glom_eggspreadtable_files =  \
  glom/utility_widgets/eggspreadtable/eggmarshalers.c \
	glom/utility_widgets/eggspreadtable/eggmarshalers.h \
	glom/utility_widgets/eggspreadtable/eggspreadtable.c \
	glom/utility_widgets/eggspreadtable/eggspreadtable.h \
	glom/utility_widgets/eggspreadtable/eggspreadtablednd.c \
	glom/utility_widgets/eggspreadtable/eggspreadtablednd.h \
	glom/utility_widgets/eggspreadtable/eggplaceholder.c \
	glom/utility_widgets/eggspreadtable/eggplaceholder.h \
	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.cc \
	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.h \
	glom/utility_widgets/eggspreadtablemm/eggspreadtabledndmm.cc \
	glom/utility_widgets/eggspreadtablemm/eggspreadtabledndmm.h \
	glom/utility_widgets/eggspreadtablemm/private/eggspreadtablemm_p.h \
	glom/utility_widgets/eggspreadtablemm/private/eggspreadtabledndmm_p.h

glom_canvas_files =  \
	glom/utility_widgets/canvas/canvas_editable.cc			\
	glom/utility_widgets/canvas/canvas_editable.h			\
	glom/utility_widgets/canvas/canvas_group_grid.cc		\
	glom/utility_widgets/canvas/canvas_group_grid.h			\
	glom/utility_widgets/canvas/canvas_group_movable.cc		\
	glom/utility_widgets/canvas/canvas_group_movable.h		\
	glom/utility_widgets/canvas/canvas_group_resizable.cc		\
	glom/utility_widgets/canvas/canvas_group_resizable.h		\
	glom/utility_widgets/canvas/canvas_image_movable.cc		\
	glom/utility_widgets/canvas/canvas_image_movable.h		\
	glom/utility_widgets/canvas/canvas_item_movable.cc		\
	glom/utility_widgets/canvas/canvas_item_movable.h		\
	glom/utility_widgets/canvas/canvas_line_movable.cc		\
	glom/utility_widgets/canvas/canvas_line_movable.h		\
	glom/utility_widgets/canvas/canvas_rect_movable.cc		\
	glom/utility_widgets/canvas/canvas_rect_movable.h		\
	glom/utility_widgets/canvas/canvas_table_movable.cc		\
	glom/utility_widgets/canvas/canvas_table_movable.h		\
	glom/utility_widgets/canvas/canvas_text_movable.cc		\
	glom/utility_widgets/canvas/canvas_text_movable.h \
	$(BUILT_SOURCES)

glom_source_files = \
	glom/appwindow.cc						\
	glom/appwindow.h						\
	glom/base_db.cc							\
	glom/base_db.h							\
	glom/base_db_table.cc						\
	glom/base_db_table.h						\
	glom/base_db_table_data.cc					\
	glom/base_db_table_data.h					\
	glom/base_db_table_data_readonly.cc \
	glom/base_db_table_data_readonly.h \
	glom/box_db_table.cc						\
	glom/box_db_table.h						\
	glom/box_reports.cc						\
	glom/box_reports.h						\
	glom/box_withbuttons.cc						\
	glom/box_withbuttons.h						\
	glom/dialog_connection.cc					\
	glom/dialog_connection.h					\
	glom/dialog_existing_or_new.cc					\
	glom/dialog_existing_or_new.h					\
	glom/dialog_invalid_data.cc					\
	glom/dialog_invalid_data.h					\
	glom/filechooser_export.cc					\
	glom/filechooser_export.h					\
	glom/frame_glom.cc						\
	glom/frame_glom.h						\
	glom/glade_utils.cc						\
	glom/glade_utils.h						\
	glom/infobar_progress_creating.cc				\
	glom/infobar_progress_creating.h				\
	glom/notebook_glom.cc						\
	glom/notebook_glom.h						\
	glom/show_progress_message.cc						\
	glom/show_progress_message.h						\
	glom/signal_reemitter.h						\
	glom/utils_ui.cc						\
	glom/utils_ui.h							\
	glom/variablesmap.cc						\
	glom/variablesmap.h						\
	glom/window_boxholder.cc					\
	glom/window_boxholder.h						\
	glom/onlineglom_strings.cc \
	glom/bakery/appwindow.cc						\
	glom/bakery/appwindow.h						\
	glom/bakery/appwindow_withdoc.cc					\
	glom/bakery/appwindow_withdoc.h					\
	glom/bakery/busy_cursor.cc					\
	glom/bakery/busy_cursor.h					\
	glom/bakery/dialog_offersave.cc					\
	glom/bakery/dialog_offersave.h					\
	glom/import_csv/dialog_import_csv.cc				\
	glom/import_csv/dialog_import_csv.h				\
	glom/import_csv/dialog_import_csv_progress.cc			\
	glom/import_csv/dialog_import_csv_progress.h			\
	glom/import_csv/file_encodings.cc				\
	glom/import_csv/file_encodings.h				\
	glom/import_csv/csv_parser.cc					\
	glom/import_csv/csv_parser.h					\
	glom/mode_data/box_data.cc					\
	glom/mode_data/box_data.h					\
	glom/mode_data/box_data_calendar_related.cc			\
	glom/mode_data/box_data_calendar_related.h			\
	glom/mode_data/box_data_details.cc				\
	glom/mode_data/box_data_details.h				\
	glom/mode_data/box_data_list.cc					\
	glom/mode_data/box_data_list.h					\
	glom/mode_data/box_data_list_related.cc				\
	glom/mode_data/box_data_list_related.h				\
	glom/mode_data/box_data_manyrecords.cc				\
	glom/mode_data/box_data_manyrecords.h				\
	glom/mode_data/box_data_portal.cc				\
	glom/mode_data/box_data_portal.h				\
	glom/mode_data/buttonglom.cc				\
	glom/mode_data/buttonglom.h				\
	glom/mode_data/db_adddel/db_adddel.cc			\
	glom/mode_data/db_adddel/db_adddel.h			\
	glom/mode_data/db_adddel/db_adddel_withbuttons.cc		\
	glom/mode_data/db_adddel/db_adddel_withbuttons.h		\
	glom/mode_data/db_adddel/db_treeviewcolumn_glom.cc	\
	glom/mode_data/db_adddel/db_treeviewcolumn_glom.h		\
	glom/mode_data/flowtablewithfields.cc				\
	glom/mode_data/flowtablewithfields.h				\
	glom/mode_data/notebook_data.cc					\
	glom/mode_data/notebook_data.h					\
	glom/mode_data/datawidget/datawidget.cc				\
	glom/mode_data/datawidget/datawidget.h				\
	glom/mode_data/datawidget/cellcreation.cc				\
	glom/mode_data/datawidget/cellcreation.h				\
	glom/mode_data/datawidget/cellrenderer_buttonimage.cc	\
	glom/mode_data/datawidget/cellrenderer_buttonimage.h	\
	glom/mode_data/datawidget/cellrenderer_buttontext.cc	\
	glom/mode_data/datawidget/cellrenderer_buttontext.h	\
	glom/mode_data/datawidget/cellrenderer_dblist.cc	\
	glom/mode_data/datawidget/cellrenderer_dblist.h	\
	glom/mode_data/datawidget/checkbutton.cc				\
	glom/mode_data/datawidget/checkbutton.h				\
	glom/mode_data/datawidget/entry.cc				\
	glom/mode_data/datawidget/entry.h				\
	glom/mode_data/datawidget/label.cc				\
	glom/mode_data/datawidget/label.h				\
	glom/mode_data/datawidget/textview.cc				\
	glom/mode_data/datawidget/textview.h				\
	glom/mode_data/datawidget/dialog_choose_date.cc			\
	glom/mode_data/datawidget/dialog_choose_date.h			\
	glom/mode_data/datawidget/dialog_choose_id.cc			\
	glom/mode_data/datawidget/dialog_choose_id.h			\
	glom/mode_data/datawidget/dialog_new_record.cc			\
	glom/mode_data/datawidget/dialog_new_record.h			\
	glom/mode_data/datawidget/combo.cc				\
	glom/mode_data/datawidget/combo.h				\
	glom/mode_data/datawidget/combochoices.cc			\
	glom/mode_data/datawidget/combochoices.h			\
	glom/mode_data/datawidget/combochoiceswithtreemodel.cc			\
	glom/mode_data/datawidget/combochoiceswithtreemodel.h			\
	glom/mode_data/datawidget/combo_as_radio_buttons.cc			\
	glom/mode_data/datawidget/combo_as_radio_buttons.h			\
	glom/mode_data/datawidget/treemodel_db.cc		\
	glom/mode_data/datawidget/treemodel_db.h \
	glom/mode_data/datawidget/treemodel_db_withextratext.cc		\
	glom/mode_data/datawidget/treemodel_db_withextratext.h \
	glom/mode_find/box_data_details_find.cc				\
	glom/mode_find/box_data_details_find.h				\
	glom/mode_find/box_data_list_find.cc				\
	glom/mode_find/box_data_list_find.h				\
	glom/mode_find/notebook_find.cc					\
	glom/mode_find/notebook_find.h					\
	glom/print_layout/canvas_layout_item.cc				\
	glom/print_layout/canvas_layout_item.h				\
	glom/print_layout/canvas_print_layout.cc			\
	glom/print_layout/canvas_print_layout.h				\
	glom/print_layout/print_layout_utils.cc \
	glom/print_layout/print_layout_utils.h \
	glom/print_layout/printoperation_printlayout.cc \
	glom/print_layout/printoperation_printlayout.h \
	glom/python_embed/glom_python.cc				\
	glom/python_embed/glom_python.h					\
	glom/python_embed/python_ui_callbacks.cc				\
	glom/python_embed/python_ui_callbacks.h					\
	glom/utility_widgets/combo_textglade.cc				\
	glom/utility_widgets/combo_textglade.h				\
	glom/utility_widgets/dialog_flowtable.cc			\
	glom/utility_widgets/dialog_flowtable.h				\
	glom/utility_widgets/dialog_image_load_progress.cc			\
	glom/utility_widgets/dialog_image_load_progress.h			\
	glom/utility_widgets/dialog_image_save_progress.cc			\
	glom/utility_widgets/dialog_image_save_progress.h			\
	glom/utility_widgets/dialog_properties.cc			\
	glom/utility_widgets/dialog_properties.h			\
	glom/utility_widgets/flowtable.cc				\
	glom/utility_widgets/flowtable.h				\
	$(glom_eggspreadtable_files) \
	glom/utility_widgets/gimpruler/gimpruler.c \
	glom/utility_widgets/gimpruler/gimpruler.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpbase.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpbaseenums.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpbasetypes.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpbase-private.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpbase-private.c \
	glom/utility_widgets/gimpruler/libgimpbase/gimpparam.h \
	glom/utility_widgets/gimpruler/libgimpbase/gimpunit.c \
	glom/utility_widgets/gimpruler/libgimpbase/gimpunit.h \
	glom/utility_widgets/gimpruler/libgimpmath/gimpmath.h \
	glom/utility_widgets/imageglom.cc				\
	glom/utility_widgets/imageglom.h				\
	glom/utility_widgets/layoutwidgetbase.cc			\
	glom/utility_widgets/layoutwidgetbase.h				\
	glom/utility_widgets/layoutwidgetfield.cc			\
	glom/utility_widgets/layoutwidgetfield.h			\
	glom/utility_widgets/layoutwidgetmenu.cc			\
	glom/utility_widgets/layoutwidgetmenu.h				\
	glom/utility_widgets/layoutwidgetutils.cc			\
	glom/utility_widgets/layoutwidgetutils.h			\
	glom/utility_widgets/notebookglom.cc				\
	glom/utility_widgets/notebookglom.h				\
	glom/utility_widgets/notebook_noframe.cc \
	glom/utility_widgets/notebook_noframe.h \
	glom/utility_widgets/placeholder.cc				\
	glom/utility_widgets/placeholder.h				\
	glom/utility_widgets/adddel/adddel.cc				\
	glom/utility_widgets/adddel/adddel.h				\
	glom/utility_widgets/adddel/adddel_withbuttons.cc		\
	glom/utility_widgets/adddel/adddel_withbuttons.h		\
	glom/utility_widgets/adddel/treeviewcolumn_glom.cc		\
	glom/utility_widgets/adddel/treeviewcolumn_glom.h		\
	$(glom_canvas_files) \
	glom/utility_widgets/cellrendererlist.cc	\
	glom/utility_widgets/cellrendererlist.h
#	examples/glom-examples-resources.c \
#	data/glom-resources.c

if !GLOM_ENABLE_CLIENT_ONLY
glom_source_files +=							\
	glom/mode_design/dialog_database_preferences.cc				\
	glom/mode_design/dialog_database_preferences.h				\
	glom/mode_design/dialog_initial_password.cc					\
	glom/mode_design/dialog_initial_password.h					\
	glom/mode_design/box_db_table_relationships.cc			\
	glom/mode_design/box_db_table_relationships.h			\
	glom/mode_design/dialog_add_related_table.cc			\
	glom/mode_design/dialog_add_related_table.h			\
	glom/mode_design/dialog_design.cc				\
	glom/mode_design/dialog_design.h				\
	glom/mode_design/dialog_fields.cc				\
	glom/mode_design/dialog_fields.h				\
	glom/mode_design/dialog_relationships.cc			\
	glom/mode_design/dialog_relationships.h				\
	glom/mode_design/iso_codes.cc					\
	glom/mode_design/iso_codes.h					\
	glom/mode_design/fields/box_db_table_definition.cc		\
	glom/mode_design/fields/box_db_table_definition.h		\
	glom/mode_design/fields/combo_fieldtype.cc			\
	glom/mode_design/fields/combo_fieldtype.h			\
	glom/mode_design/fields/dialog_defaultformatting.cc		\
	glom/mode_design/fields/dialog_defaultformatting.h		\
	glom/mode_design/fields/dialog_fieldcalculation.cc		\
	glom/mode_design/fields/dialog_fieldcalculation.h		\
	glom/mode_design/fields/dialog_fielddefinition.cc		\
	glom/mode_design/fields/dialog_fielddefinition.h		\
	glom/mode_design/layout/combobox_fields.cc			\
	glom/mode_design/layout/combobox_fields.h			\
	glom/mode_design/layout/combobox_relationship.cc		\
	glom/mode_design/layout/combobox_relationship.h			\
	glom/mode_design/layout/dialog_choose_field.cc				\
	glom/mode_design/layout/dialog_choose_field.h				\
	glom/mode_design/layout/dialog_choose_relationship.cc			\
	glom/mode_design/layout/dialog_choose_relationship.h			\
	glom/mode_design/layout/dialog_layout.cc				\
	glom/mode_design/layout/dialog_layout.h					\
	glom/mode_design/layout/dialog_layout_export.cc				\
	glom/mode_design/layout/dialog_layout_export.h				\
	glom/mode_design/layout/dialog_layout_calendar_related.cc		\
	glom/mode_design/layout/dialog_layout_calendar_related.h		\
	glom/mode_design/layout/dialog_layout_details.cc			\
	glom/mode_design/layout/dialog_layout_details.h				\
	glom/mode_design/layout/dialog_layout_list.cc				\
	glom/mode_design/layout/dialog_layout_list.h				\
	glom/mode_design/layout/dialog_layout_list_related.cc			\
	glom/mode_design/layout/dialog_layout_list_related.h			\
	glom/mode_design/layout/treestore_layout.cc				\
	glom/mode_design/layout/treestore_layout.h				\
	glom/mode_design/layout/layout_item_dialogs/box_formatting.cc			\
	glom/mode_design/layout/layout_item_dialogs/box_formatting.h			\
	glom/mode_design/layout/layout_item_dialogs/combo_summarytype.cc		\
	glom/mode_design/layout/layout_item_dialogs/combo_summarytype.h			\
	glom/mode_design/layout/layout_item_dialogs/comboentry_borderwidth.cc		\
	glom/mode_design/layout/layout_item_dialogs/comboentry_borderwidth.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_field_summary.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_field_summary.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_formatting.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_formatting.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_group_by.cc			\
	glom/mode_design/layout/layout_item_dialogs/dialog_group_by.h			\
	glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc	\
	glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.h	\
	glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_line.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_line.h			\
	glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.cc	\
	glom/mode_design/layout/layout_item_dialogs/dialog_sortfields.h		\
	glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc		\
	glom/mode_design/layout/layout_item_dialogs/dialog_textobject.h			\
	glom/mode_design/relationships_overview/canvas_group_dbtable.cc			\
	glom/mode_design/relationships_overview/canvas_group_dbtable.h			\
	glom/mode_design/relationships_overview/printoperation_relationshipsoverview.cc	\
	glom/mode_design/relationships_overview/printoperation_relationshipsoverview.h	\
	glom/mode_design/relationships_overview/window_relationships_overview.cc	\
	glom/mode_design/relationships_overview/window_relationships_overview.h		\
	glom/mode_design/print_layouts/box_print_layouts.cc		\
	glom/mode_design/print_layouts/box_print_layouts.h		\
	glom/mode_design/print_layouts/dialog_text_formatting.cc	\
	glom/mode_design/print_layouts/dialog_text_formatting.h		\
	glom/mode_design/print_layouts/print_layout_toolbar.cc		\
	glom/mode_design/print_layouts/print_layout_toolbar.h		\
	glom/mode_design/print_layouts/print_layout_toolbar_button.cc	\
	glom/mode_design/print_layouts/print_layout_toolbar_button.h	\
	glom/mode_design/print_layouts/window_print_layout_edit.cc	\
	glom/mode_design/print_layouts/window_print_layout_edit.h	\
	glom/mode_design/report_layout/dialog_layout_report.cc		\
	glom/mode_design/report_layout/dialog_layout_report.h		\
	glom/mode_design/report_layout/treestore_report_layout.cc	\
	glom/mode_design/report_layout/treestore_report_layout.h	\
	glom/mode_design/script_library/dialog_new_script.cc		\
	glom/mode_design/script_library/dialog_new_script.h		\
	glom/mode_design/script_library/dialog_script_library.cc	\
	glom/mode_design/script_library/dialog_script_library.h		\
	glom/mode_design/users/dialog_choose_user.cc			\
	glom/mode_design/users/dialog_choose_user.h			\
	glom/mode_design/users/dialog_groups_list.cc			\
	glom/mode_design/users/dialog_groups_list.h			\
	glom/mode_design/users/dialog_new_group.cc			\
	glom/mode_design/users/dialog_new_group.h			\
	glom/mode_design/users/dialog_user.cc				\
	glom/mode_design/users/dialog_user.h				\
	glom/mode_design/users/dialog_users_list.cc			\
	glom/mode_design/users/dialog_users_list.h			\
	glom/mode_design/comboentry_currency.cc				\
	glom/mode_design/comboentry_currency.h				\
	glom/mode_design/translation/combobox_locale.cc				\
	glom/mode_design/translation/combobox_locale.h				\
	glom/mode_design/translation/dialog_change_language.cc			\
	glom/mode_design/translation/dialog_change_language.h			\
	glom/mode_design/translation/dialog_copy_translation.cc			\
	glom/mode_design/translation/dialog_copy_translation.h			\
	glom/mode_design/translation/dialog_identify_original.cc			\
	glom/mode_design/translation/dialog_identify_original.h			\
	glom/mode_design/translation/window_translations.cc				\
	glom/mode_design/translation/window_translations.h				\
	glom/utility_widgets/filechooserdialog_saveextras.cc		\
	glom/utility_widgets/filechooserdialog_saveextras.h		\
	glom/utility_widgets/layouttoolbar.cc				\
	glom/utility_widgets/layouttoolbar.h				\
	glom/utility_widgets/layouttoolbarbutton.cc			\
	glom/utility_widgets/layouttoolbarbutton.h			\
	glom/utility_widgets/notebooklabelglom.cc			\
	glom/utility_widgets/notebooklabelglom.h
endif

glom_source_files +=							\
	glom/navigation/box_tables.cc					\
	glom/navigation/box_tables.h

glom_glom_SOURCES =							\
	glom/application.cc						\
	glom/application.h						\
	glom/main.cc							\
	glom/main_local_options.cc \
	glom/main_local_options.h \
	glom/main_remote_options.cc \
	glom/main_remote_options.h \
	$(glom_source_files)

glom_all_libs = $(win_resfile) \
	glom/libglom/libglom-$(GLOM_ABI_VERSION).la $(libglom_all_libs) \
	$(GLOM_LIBS) $(INTLLIBS)

glom_glom_LDADD = $(glom_all_libs)

if HOST_WIN32
# Suppress console window
glom_glom_LDFLAGS = -mwindows
else
glom_glom_LDFLAGS =
endif
