[evolution] Convert from autotools to CMake



commit 3cba4951951a40e299296b0a401f9406ac3ac9a2
Author: Milan Crha <mcrha redhat com>
Date:   Mon Oct 10 14:46:59 2016 +0200

    Convert from autotools to CMake

 .gitignore                                         |    3 +
 CMakeLists.txt                                     |  701 ++++++++
 Makefile.am                                        |  168 --
 README                                             |   29 +-
 addressbook/CMakeLists.txt                         |    6 +
 addressbook/Makefile.am                            |   18 -
 addressbook/gui/CMakeLists.txt                     |    3 +
 addressbook/gui/Makefile.am                        |    3 -
 addressbook/gui/contact-editor/CMakeLists.txt      |   60 +
 addressbook/gui/contact-editor/Makefile.am         |   47 -
 .../gui/contact-editor/e-contact-editor-fullname.c |    4 +-
 addressbook/gui/contact-editor/e-contact-editor.c  |    4 +-
 .../gui/contact-editor/e-contact-quick-add.c       |    4 +-
 addressbook/gui/contact-editor/eab-editor.c        |    4 +-
 addressbook/gui/contact-editor/test-editor.c       |    4 +-
 addressbook/gui/contact-list-editor/CMakeLists.txt |   55 +
 addressbook/gui/contact-list-editor/Makefile.am    |   38 -
 .../contact-list-editor/e-contact-list-editor.c    |    8 +-
 .../gui/contact-list-editor/e-contact-list-model.c |    4 +-
 addressbook/gui/widgets/CMakeLists.txt             |  117 ++
 addressbook/gui/widgets/Makefile.am                |   97 --
 addressbook/gui/widgets/e-addressbook-model.c      |    4 +-
 .../gui/widgets/e-addressbook-reflow-adapter.c     |    4 +-
 addressbook/gui/widgets/e-addressbook-selector.c   |    8 +-
 .../gui/widgets/e-addressbook-table-adapter.c      |    4 +-
 addressbook/gui/widgets/e-addressbook-view.c       |    4 +-
 addressbook/gui/widgets/e-contact-map-window.c     |    9 +-
 addressbook/gui/widgets/e-contact-map-window.h     |    4 +-
 addressbook/gui/widgets/e-contact-map.c            |    8 +-
 addressbook/gui/widgets/e-contact-map.h            |    4 +-
 addressbook/gui/widgets/e-minicard-label.c         |    4 +-
 addressbook/gui/widgets/e-minicard-view-widget.c   |    4 +-
 addressbook/gui/widgets/e-minicard-view.c          |    4 +-
 addressbook/gui/widgets/e-minicard.c               |    4 +-
 addressbook/gui/widgets/ea-addressbook-view.c      |    4 +-
 addressbook/gui/widgets/ea-addressbook.c           |    4 +-
 addressbook/gui/widgets/ea-minicard-view.c         |    4 +-
 addressbook/gui/widgets/ea-minicard.c              |    4 +-
 addressbook/gui/widgets/eab-config.c               |    4 +-
 addressbook/gui/widgets/eab-contact-compare.c      |    4 +-
 addressbook/gui/widgets/eab-contact-display.c      |    8 +-
 addressbook/gui/widgets/eab-contact-formatter.c    |    9 +-
 addressbook/gui/widgets/eab-contact-merging.c      |    4 +-
 addressbook/gui/widgets/eab-gui-util.c             |    8 +-
 addressbook/gui/widgets/gal-view-minicard.c        |    4 +-
 addressbook/gui/widgets/gal-view-minicard.h        |    2 +-
 addressbook/importers/CMakeLists.txt               |   48 +
 addressbook/importers/Makefile.am                  |   33 -
 addressbook/importers/evolution-csv-importer.c     |    4 +-
 addressbook/importers/evolution-ldif-importer.c    |    4 +-
 addressbook/importers/evolution-vcard-importer.c   |    4 +-
 addressbook/printing/CMakeLists.txt                |   55 +
 addressbook/printing/Makefile.am                   |   38 -
 addressbook/printing/e-contact-print.c             |    4 +-
 addressbook/util/CMakeLists.txt                    |   46 +
 addressbook/util/Makefile.am                       |   36 -
 addressbook/util/eab-book-util.c                   |    4 +-
 art/CMakeLists.txt                                 |   18 +
 art/Makefile.am                                    |   21 -
 autogen.sh                                         |   43 -
 calendar/CMakeLists.txt                            |    5 +
 calendar/Makefile.am                               |   19 -
 calendar/alarm-notify/CMakeLists.txt               |   91 ++
 calendar/alarm-notify/Makefile.am                  |   75 -
 calendar/alarm-notify/alarm-notify-dialog.c        |    4 +-
 calendar/alarm-notify/alarm-notify.c               |    4 +-
 calendar/alarm-notify/alarm-queue.c                |    4 +-
 calendar/alarm-notify/alarm.c                      |    4 +-
 calendar/alarm-notify/config-data.c                |    4 +-
 calendar/alarm-notify/notify-main.c                |    4 +-
 calendar/alarm-notify/util.c                       |    4 +-
 calendar/gui/CMakeLists.txt                        |  218 +++
 calendar/gui/Makefile.am                           |  245 ---
 calendar/gui/calendar-config.c                     |    4 +-
 calendar/gui/{caltypes.xml => caltypes.xml.in}     |  126 +-
 calendar/gui/comp-util.c                           |    4 +-
 calendar/gui/e-alarm-list.c                        |    4 +-
 calendar/gui/e-cal-component-preview.c             |    4 +-
 calendar/gui/e-cal-config.c                        |    4 +-
 calendar/gui/e-cal-data-model-subscriber.c         |    4 +-
 calendar/gui/e-cal-data-model.c                    |    4 +-
 calendar/gui/e-cal-dialogs.c                       |    4 +-
 calendar/gui/e-cal-event.c                         |    4 +-
 calendar/gui/e-cal-list-view.c                     |    4 +-
 calendar/gui/e-cal-model-calendar.c                |    4 +-
 calendar/gui/e-cal-model-memos.c                   |    4 +-
 calendar/gui/e-cal-model-tasks.c                   |    4 +-
 calendar/gui/e-cal-model.c                         |    4 +-
 calendar/gui/e-cal-ops.c                           |    4 +-
 calendar/gui/e-calendar-view.c                     |    4 +-
 calendar/gui/e-cell-date-edit-text.c               |    4 +-
 calendar/gui/e-comp-editor-event.c                 |    4 +-
 calendar/gui/e-comp-editor-memo.c                  |    4 +-
 calendar/gui/e-comp-editor-page-attachments.c      |    4 +-
 calendar/gui/e-comp-editor-page-general.c          |    4 +-
 calendar/gui/e-comp-editor-page-recurrence.c       |    4 +-
 calendar/gui/e-comp-editor-page-reminders.c        |    4 +-
 calendar/gui/e-comp-editor-page-schedule.c         |    4 +-
 calendar/gui/e-comp-editor-page.c                  |    4 +-
 calendar/gui/e-comp-editor-property-part.c         |    4 +-
 calendar/gui/e-comp-editor-property-parts.c        |    4 +-
 calendar/gui/e-comp-editor-task.c                  |    4 +-
 calendar/gui/e-comp-editor.c                       |    4 +-
 calendar/gui/e-date-time-list.c                    |    4 +-
 calendar/gui/e-day-view-layout.c                   |    4 +-
 calendar/gui/e-day-view-main-item.c                |    4 +-
 calendar/gui/e-day-view-time-item.c                |    4 +-
 calendar/gui/e-day-view-top-item.c                 |    4 +-
 calendar/gui/e-day-view.c                          |    4 +-
 calendar/gui/e-meeting-attendee.c                  |    4 +-
 calendar/gui/e-meeting-list-view.c                 |    4 +-
 calendar/gui/e-meeting-store.c                     |    4 +-
 calendar/gui/e-meeting-time-sel-item.c             |    4 +-
 calendar/gui/e-meeting-time-sel.c                  |    4 +-
 calendar/gui/e-meeting-utils.c                     |    4 +-
 calendar/gui/e-memo-table.c                        |    4 +-
 calendar/gui/e-month-view.c                        |    4 +-
 calendar/gui/e-select-names-editable.c             |    4 +-
 calendar/gui/e-select-names-renderer.c             |    4 +-
 calendar/gui/e-send-options-utils.c                |    4 +-
 calendar/gui/e-task-table.c                        |    4 +-
 calendar/gui/e-timezone-entry.c                    |    4 +-
 calendar/gui/e-week-view-event-item.c              |    4 +-
 calendar/gui/e-week-view-layout.c                  |    4 +-
 calendar/gui/e-week-view-main-item.c               |    4 +-
 calendar/gui/e-week-view-titles-item.c             |    4 +-
 calendar/gui/e-week-view.c                         |    4 +-
 calendar/gui/e-weekday-chooser.c                   |    5 +-
 calendar/gui/ea-cal-view-event.c                   |    4 +-
 calendar/gui/ea-cal-view.c                         |    4 +-
 calendar/gui/ea-calendar-helpers.c                 |    4 +-
 calendar/gui/ea-calendar.c                         |    4 +-
 calendar/gui/ea-day-view-cell.c                    |    4 +-
 calendar/gui/ea-day-view-main-item.c               |    4 +-
 calendar/gui/ea-day-view.c                         |    4 +-
 calendar/gui/ea-jump-button.c                      |    4 +-
 calendar/gui/ea-week-view-cell.c                   |    4 +-
 calendar/gui/ea-week-view-main-item.c              |    4 +-
 calendar/gui/ea-week-view.c                        |    4 +-
 calendar/gui/itip-utils.c                          |    4 +-
 calendar/gui/{memotypes.xml => memotypes.xml.in}   |   54 +-
 calendar/gui/misc.c                                |    4 +-
 calendar/gui/print.c                               |    4 +-
 calendar/gui/tag-calendar.c                        |    4 +-
 calendar/gui/{tasktypes.xml => tasktypes.xml.in}   |   20 +-
 calendar/importers/CMakeLists.txt                  |   47 +
 calendar/importers/Makefile.am                     |   28 -
 calendar/importers/icalendar-importer.c            |    4 +-
 cmake/cmake_uninstall.cmake.in                     |   21 +
 cmake/modules/CheckTarget.cmake                    |   21 +
 cmake/modules/CodeCoverageGCOV.cmake               |   45 +
 cmake/modules/DistTargets.cmake                    |   87 +
 cmake/modules/EvolutionMacros.cmake                |   63 +
 cmake/modules/FindIntltool.cmake                   |  209 +++
 cmake/modules/FindLDAP.cmake                       |  133 ++
 cmake/modules/FindSMIME.cmake                      |  146 ++
 cmake/modules/GLibTools.cmake                      |  277 ++++
 cmake/modules/GtkDoc.cmake                         |  150 ++
 cmake/modules/IconCache.cmake                      |   74 +
 cmake/modules/InstalledTests.cmake                 |   88 +
 cmake/modules/PkgConfigEx.cmake                    |   90 ++
 cmake/modules/PrintableOptions.cmake               |   74 +
 cmake/modules/SetupBuildFlags.cmake                |   80 +
 cmake/modules/UninstallTarget.cmake                |   13 +
 cmake/verify-news-file.sh                          |   56 +
 composer/CMakeLists.txt                            |   85 +
 composer/Makefile.am                               |   79 -
 composer/e-composer-actions.c                      |    6 +-
 composer/e-composer-from-header.c                  |    4 +-
 composer/e-composer-header-table.c                 |    4 +-
 composer/e-composer-header.c                       |    4 +-
 composer/e-composer-name-header.c                  |    4 +-
 composer/e-composer-post-header.c                  |    4 +-
 composer/e-composer-private.c                      |    4 +-
 composer/e-composer-spell-header.c                 |    4 +-
 composer/e-composer-text-header.c                  |    4 +-
 composer/e-msg-composer.c                          |   14 +-
 config.h.in                                        |  127 ++
 configure.ac                                       | 1675 --------------------
 data/CMakeLists.txt                                |   79 +
 data/Makefile.am                                   |   75 -
 data/icons/CMakeLists.txt                          |  234 +++
 data/icons/Makefile.am                             |  296 ----
 doc/CMakeLists.txt                                 |    1 +
 doc/Makefile.am                                    |    3 -
 doc/devel/Makefile.am                              |  177 --
 doc/reference/CMakeLists.txt                       |    5 +
 doc/reference/Makefile.am                          |   11 -
 .../evolution-mail-composer/CMakeLists.txt         |   14 +
 doc/reference/evolution-mail-composer/Makefile.am  |   50 -
 ...s.sgml => evolution-mail-composer-docs.sgml.in} |    5 -
 doc/reference/evolution-mail-engine/CMakeLists.txt |   13 +
 doc/reference/evolution-mail-engine/Makefile.am    |   49 -
 ...ocs.sgml => evolution-mail-engine-docs.sgml.in} |    5 -
 .../evolution-mail-formatter/CMakeLists.txt        |   13 +
 doc/reference/evolution-mail-formatter/Makefile.am |   49 -
 ....sgml => evolution-mail-formatter-docs.sgml.in} |    5 -
 doc/reference/evolution-shell/CMakeLists.txt       |   17 +
 doc/reference/evolution-shell/Makefile.am          |   53 -
 ...hell-docs.sgml => evolution-shell-docs.sgml.in} |    5 -
 doc/reference/evolution-util/CMakeLists.txt        |   49 +
 doc/reference/evolution-util/Makefile.am           |   86 -
 ...-util-docs.sgml => evolution-util-docs.sgml.in} |    5 -
 e-util/CMakeLists.txt                              |  769 +++++++++
 e-util/Makefile.am                                 |  788 ---------
 e-util/e-action-combo-box.c                        |    4 +-
 e-util/e-activity-bar.c                            |    4 +-
 e-util/e-activity-proxy.c                          |    4 +-
 e-util/e-activity.c                                |    4 +-
 e-util/e-alert-bar.c                               |    4 +-
 e-util/e-alert-dialog.c                            |    4 +-
 e-util/e-alert-sink.c                              |    4 +-
 e-util/e-alert.c                                   |    4 +-
 e-util/e-attachment-bar.c                          |    4 +-
 e-util/e-attachment-dialog.c                       |    4 +-
 e-util/e-attachment-handler-image.c                |    4 +-
 e-util/e-attachment-handler.c                      |    4 +-
 e-util/e-attachment-icon-view.c                    |    4 +-
 e-util/e-attachment-paned.c                        |    4 +-
 e-util/e-attachment-store.c                        |    4 +-
 e-util/e-attachment-tree-view.c                    |    4 +-
 e-util/e-attachment-view.c                         |    4 +-
 e-util/e-attachment.c                              |    4 +-
 e-util/e-bit-array.c                               |    4 +-
 e-util/e-book-source-config.c                      |    3 +-
 e-util/e-buffer-tagger.c                           |    4 +-
 e-util/e-cal-source-config.c                       |    4 +-
 e-util/e-calendar-item.c                           |    4 +-
 e-util/e-calendar.c                                |    4 +-
 e-util/e-canvas-background.c                       |    4 +-
 e-util/e-canvas-utils.c                            |    5 +-
 e-util/e-canvas-vbox.c                             |    4 +-
 e-util/e-canvas.c                                  |    6 +-
 e-util/e-categories-config.c                       |    4 +-
 e-util/e-categories-dialog.c                       |    4 +-
 e-util/e-categories-editor.c                       |    3 +-
 e-util/e-categories-selector.c                     |    3 +-
 e-util/e-category-completion.c                     |    7 +-
 e-util/e-category-editor.c                         |    5 +-
 e-util/e-cell-checkbox.c                           |    4 +-
 e-util/e-cell-combo.c                              |    4 +-
 e-util/e-cell-date-edit.c                          |    4 +-
 e-util/e-cell-date-int.c                           |    4 +-
 e-util/e-cell-date.c                               |    4 +-
 e-util/e-cell-hbox.c                               |    4 +-
 e-util/e-cell-number.c                             |    4 +-
 e-util/e-cell-percent.c                            |    4 +-
 e-util/e-cell-pixbuf.c                             |    4 +-
 e-util/e-cell-popup.c                              |    4 +-
 e-util/e-cell-size.c                               |    4 +-
 e-util/e-cell-text.c                               |    4 +-
 e-util/e-cell-toggle.c                             |    4 +-
 e-util/e-cell-tree.c                               |    4 +-
 e-util/e-cell-vbox.c                               |    4 +-
 e-util/e-cell.c                                    |    4 +-
 e-util/e-charset-combo-box.c                       |    4 +-
 e-util/e-charset.c                                 |    4 +-
 e-util/e-client-cache.c                            |    5 +-
 e-util/e-client-selector.c                         |    4 +-
 e-util/e-color-chooser-widget.c                    |    4 +-
 e-util/e-color-combo.c                             |    4 +-
 e-util/e-config.c                                  |    4 +-
 e-util/e-contact-store.c                           |    4 +-
 e-util/e-content-editor.c                          |    4 +-
 e-util/e-content-request.c                         |    4 +-
 e-util/e-dateedit.c                                |    4 +-
 e-util/e-datetime-format.c                         |    4 +-
 e-util/e-destination-store.c                       |    4 +-
 e-util/e-dialog-utils.c                            |    4 +-
 e-util/e-dialog-widgets.c                          |    4 +-
 e-util/e-emoticon-chooser-menu.c                   |    4 +-
 e-util/e-emoticon-chooser.c                        |    4 +-
 e-util/e-emoticon-tool-button.c                    |    4 +-
 e-util/e-event.c                                   |    4 +-
 e-util/e-file-request.c                            |    4 +-
 e-util/e-file-utils.c                              |    5 +-
 e-util/e-filter-code.c                             |    4 +-
 e-util/e-filter-color.c                            |    4 +-
 e-util/e-filter-datespec.c                         |    4 +-
 e-util/e-filter-element.c                          |    4 +-
 e-util/e-filter-file.c                             |    4 +-
 e-util/e-filter-input.c                            |    4 +-
 e-util/e-filter-int.c                              |    4 +-
 e-util/e-filter-option.c                           |    4 +-
 e-util/e-filter-part.c                             |    4 +-
 e-util/e-filter-rule.c                             |    4 +-
 e-util/e-focus-tracker.c                           |    4 +-
 e-util/e-html-editor-actions.c                     |    4 +-
 e-util/e-html-editor-cell-dialog.c                 |    4 +-
 e-util/e-html-editor-dialog.c                      |    4 +-
 e-util/e-html-editor-find-dialog.c                 |    4 +-
 e-util/e-html-editor-hrule-dialog.c                |    4 +-
 e-util/e-html-editor-image-dialog.c                |    4 +-
 e-util/e-html-editor-link-dialog.c                 |    4 +-
 e-util/e-html-editor-page-dialog.c                 |    4 +-
 e-util/e-html-editor-paragraph-dialog.c            |    4 +-
 e-util/e-html-editor-private.h                     |   30 +-
 e-util/e-html-editor-replace-dialog.c              |    4 +-
 e-util/e-html-editor-spell-check-dialog.c          |    4 +-
 e-util/e-html-editor-table-dialog.c                |    4 +-
 e-util/e-html-editor-text-dialog.c                 |    4 +-
 e-util/e-html-editor.c                             |    3 +-
 e-util/e-html-utils.c                              |    4 +-
 e-util/e-icon-factory.c                            |    4 +-
 e-util/e-image-chooser-dialog.c                    |    4 +-
 e-util/e-image-chooser.c                           |    4 +-
 e-util/e-import-assistant.c                        |    4 +-
 e-util/e-import.c                                  |    4 +-
 e-util/e-interval-chooser.c                        |    5 +-
 e-util/e-mail-identity-combo-box.c                 |    5 +-
 e-util/e-mail-signature-combo-box.c                |    5 +-
 e-util/e-mail-signature-editor.c                   |    5 +-
 e-util/e-mail-signature-script-dialog.c            |    5 +-
 e-util/e-map.c                                     |    5 +-
 e-util/e-menu-tool-action.c                        |    4 +-
 e-util/e-menu-tool-button.c                        |    4 +-
 e-util/e-misc-utils.c                              |    4 +-
 e-util/e-mktemp.c                                  |    4 +-
 e-util/e-name-selector-dialog.c                    |    5 +-
 e-util/e-name-selector-entry.c                     |    3 +-
 e-util/e-name-selector-list.c                      |    3 +-
 e-util/e-name-selector-model.c                     |    4 +-
 e-util/e-name-selector.c                           |    4 +-
 e-util/e-online-button.c                           |    4 +-
 e-util/e-paned.c                                   |    4 +-
 e-util/e-passwords.c                               |    4 +-
 e-util/e-picture-gallery.c                         |    4 +-
 e-util/e-plugin-ui.c                               |    4 +-
 e-util/e-plugin.c                                  |    4 +-
 e-util/e-poolv.c                                   |    4 +-
 e-util/e-popup-action.c                            |    4 +-
 e-util/e-popup-menu.c                              |    4 +-
 e-util/e-port-entry.c                              |    5 +-
 e-util/e-preferences-window.c                      |    4 +-
 e-util/e-print.c                                   |    4 +-
 e-util/e-printable.c                               |    4 +-
 e-util/e-proxy-editor.c                            |    5 +-
 e-util/e-proxy-preferences.c                       |   11 +-
 e-util/e-proxy-selector.c                          |    5 +-
 e-util/e-reflow-model.c                            |    4 +-
 e-util/e-reflow.c                                  |    4 +-
 e-util/e-rule-context.c                            |    4 +-
 e-util/e-rule-editor.c                             |    4 +-
 e-util/e-search-bar.c                              |    4 +-
 e-util/e-selectable.c                              |    4 +-
 e-util/e-selection-model-array.c                   |    4 +-
 e-util/e-selection-model-simple.c                  |    4 +-
 e-util/e-selection-model.c                         |    4 +-
 e-util/e-selection.c                               |    4 +-
 e-util/e-send-options.c                            |    4 +-
 e-util/e-simple-async-result.c                     |    4 +-
 e-util/e-source-combo-box.c                        |    4 +-
 e-util/e-source-config-dialog.c                    |    4 +-
 e-util/e-source-config.c                           |    5 +-
 e-util/e-source-selector-dialog.c                  |    4 +-
 e-util/e-source-selector.c                         |    4 +-
 e-util/e-spell-checker.c                           |    4 +-
 e-util/e-spell-dictionary.c                        |    4 +-
 e-util/e-spell-entry.c                             |    3 +-
 e-util/e-spell-text-view.c                         |   22 +-
 e-util/e-spinner.c                                 |    4 +-
 e-util/e-stock-request.c                           |    4 +-
 e-util/e-table-click-to-add.c                      |    4 +-
 e-util/e-table-col.c                               |    4 +-
 e-util/e-table-column-selector.c                   |    6 +-
 e-util/e-table-column-specification.c              |    4 +-
 e-util/e-table-config.c                            |    4 +-
 e-util/e-table-extras.c                            |    4 +-
 e-util/e-table-field-chooser-dialog.c              |    4 +-
 e-util/e-table-field-chooser-item.c                |    4 +-
 e-util/e-table-field-chooser.c                     |    4 +-
 e-util/e-table-group-container.c                   |    4 +-
 e-util/e-table-group-leaf.c                        |    4 +-
 e-util/e-table-group.c                             |    4 +-
 e-util/e-table-header-item.c                       |    4 +-
 e-util/e-table-header-utils.c                      |    4 +-
 e-util/e-table-header.c                            |    4 +-
 e-util/e-table-item.c                              |    5 +-
 e-util/e-table-one.c                               |    4 +-
 e-util/e-table-search.c                            |    4 +-
 e-util/e-table-selection-model.c                   |    4 +-
 e-util/e-table-sorted-variable.c                   |    4 +-
 e-util/e-table-sorted.c                            |    4 +-
 e-util/e-table-sorter.c                            |    4 +-
 e-util/e-table-sorting-utils.c                     |    4 +-
 e-util/e-table-subset-variable.c                   |    4 +-
 e-util/e-table-subset.c                            |    4 +-
 e-util/e-table-utils.c                             |    4 +-
 e-util/e-table.c                                   |    4 +-
 e-util/e-text-event-processor-emacs-like.c         |    4 +-
 e-util/e-text-event-processor.c                    |    4 +-
 e-util/e-text-model-repos.c                        |    4 +-
 e-util/e-text-model.c                              |    4 +-
 e-util/e-text.c                                    |    5 +-
 e-util/e-timezone-dialog.c                         |    4 +-
 e-util/e-tree-model-generator.c                    |    4 +-
 e-util/e-tree-selection-model.c                    |    4 +-
 e-util/e-tree-view-frame.c                         |    4 +-
 e-util/e-tree.c                                    |    4 +-
 e-util/e-unicode.c                                 |    4 +-
 e-util/e-url-entry.c                               |    4 +-
 e-util/e-web-view-preview.c                        |    4 +-
 e-util/e-web-view.c                                |    7 +-
 e-util/e-widget-undo.c                             |    4 +-
 e-util/e-win32-defaults.c                          |    4 +-
 e-util/e-win32-reloc.c                             |    4 +-
 e-util/e-xml-utils.c                               |    4 +-
 e-util/ea-calendar-cell.c                          |    4 +-
 e-util/ea-calendar-item.c                          |    4 +-
 e-util/ea-cell-table.c                             |    4 +-
 e-util/ea-widgets.c                                |    4 +-
 e-util/evolution-source-viewer.c                   |    3 +-
 e-util/gal-a11y-e-cell-popup.c                     |    4 +-
 e-util/gal-a11y-e-cell-registry.c                  |    4 +-
 e-util/gal-a11y-e-cell-text.c                      |    2 +-
 e-util/gal-a11y-e-cell-toggle.c                    |    4 +-
 e-util/gal-a11y-e-cell-tree.c                      |    4 +-
 e-util/gal-a11y-e-cell-vbox.c                      |    4 +-
 e-util/gal-a11y-e-cell.c                           |    4 +-
 e-util/gal-a11y-e-table-click-to-add-factory.c     |    4 +-
 e-util/gal-a11y-e-table-click-to-add.c             |    4 +-
 e-util/gal-a11y-e-table-column-header.c            |    4 +-
 e-util/gal-a11y-e-table-factory.c                  |    4 +-
 e-util/gal-a11y-e-table-item-factory.c             |    4 +-
 e-util/gal-a11y-e-table-item.c                     |    4 +-
 e-util/gal-a11y-e-table.c                          |    4 +-
 e-util/gal-a11y-e-text-factory.c                   |    4 +-
 e-util/gal-a11y-e-text.c                           |    4 +-
 e-util/gal-a11y-e-tree-factory.c                   |    4 +-
 e-util/gal-a11y-e-tree.c                           |    4 +-
 e-util/gal-a11y-util.c                             |    4 +-
 e-util/gal-view-instance-save-as-dialog.c          |    4 +-
 e-util/gal-view-instance.c                         |    4 +-
 e-util/test-calendar.c                             |    4 +-
 e-util/test-dateedit.c                             |    4 +-
 e-util/test-html-editor-units-bugs.c               |    4 +-
 e-util/test-html-editor-units-utils.c              |    4 +-
 e-util/test-html-editor-units.c                    |    4 +-
 e-util/test-html-editor.c                          |    4 +-
 e-util/test-keyfile-settings-backend.c             |    4 +-
 e-util/test-source-combo-box.c                     |    3 +-
 em-format/CMakeLists.txt                           |  146 ++
 em-format/Makefile.am                              |  149 --
 em-format/e-mail-extension-registry.c              |    8 +-
 em-format/e-mail-formatter-attachment.c            |    4 +-
 em-format/e-mail-formatter-audio.c                 |    4 +-
 em-format/e-mail-formatter-error.c                 |    4 +-
 em-format/e-mail-formatter-headers.c               |    4 +-
 em-format/e-mail-formatter-image.c                 |    4 +-
 em-format/e-mail-formatter-message-rfc822.c        |    4 +-
 em-format/e-mail-formatter-print-headers.c         |    4 +-
 em-format/e-mail-formatter-quote-headers.c         |    4 +-
 em-format/e-mail-formatter-quote-message-rfc822.c  |    4 +-
 em-format/e-mail-formatter-quote-text-enriched.c   |    4 +-
 em-format/e-mail-formatter-quote-text-html.c       |    4 +-
 em-format/e-mail-formatter-quote-text-plain.c      |    4 +-
 em-format/e-mail-formatter-secure-button.c         |    4 +-
 em-format/e-mail-formatter-source.c                |    4 +-
 em-format/e-mail-formatter-text-enriched.c         |    4 +-
 em-format/e-mail-formatter-text-html.c             |    4 +-
 em-format/e-mail-formatter-text-plain.c            |    4 +-
 em-format/e-mail-formatter-utils.c                 |    4 +-
 em-format/e-mail-inline-filter.c                   |    4 +-
 em-format/e-mail-parser-application-mbox.c         |    4 +-
 em-format/e-mail-parser-application-smime.c        |    4 +-
 em-format/e-mail-parser-audio.c                    |    4 +-
 em-format/e-mail-parser-extension.c                |    4 +-
 em-format/e-mail-parser-headers.c                  |    4 +-
 em-format/e-mail-parser-image.c                    |    4 +-
 em-format/e-mail-parser-inlinepgp-encrypted.c      |    4 +-
 em-format/e-mail-parser-inlinepgp-signed.c         |    4 +-
 em-format/e-mail-parser-message-deliverystatus.c   |    4 +-
 em-format/e-mail-parser-message-external.c         |    4 +-
 em-format/e-mail-parser-message-rfc822.c           |    4 +-
 em-format/e-mail-parser-message.c                  |    4 +-
 em-format/e-mail-parser-multipart-alternative.c    |    4 +-
 em-format/e-mail-parser-multipart-appledouble.c    |    4 +-
 em-format/e-mail-parser-multipart-digest.c         |    4 +-
 em-format/e-mail-parser-multipart-encrypted.c      |    4 +-
 em-format/e-mail-parser-multipart-mixed.c          |    4 +-
 em-format/e-mail-parser-multipart-related.c        |    4 +-
 em-format/e-mail-parser-multipart-signed.c         |    4 +-
 em-format/e-mail-parser-secure-button.c            |    4 +-
 em-format/e-mail-parser-source.c                   |    4 +-
 em-format/e-mail-parser-text-enriched.c            |    4 +-
 em-format/e-mail-parser-text-html.c                |    4 +-
 em-format/e-mail-parser-text-plain.c               |    4 +-
 em-format/e-mail-parser.c                          |    6 +-
 em-format/e-mail-part-headers.c                    |    4 +-
 em-format/e-mail-part-secure-button.c              |   12 +-
 em-format/e-mail-part-utils.c                      |    4 +-
 em-format/e-mail-part.c                            |    4 +-
 em-format/e-mail-stripsig-filter.c                 |    6 +-
 enumtypes.c.template                               |   37 -
 enumtypes.h.template                               |   24 -
 evolution-calendar.pc.in                           |   14 +-
 evolution-mail.pc.in                               |   14 +-
 evolution-shell.pc.in                              |   21 +-
 git.mk                                             |  224 ---
 help/CMakeLists.txt                                |  330 ++++
 help/Makefile.am                                   |  245 ---
 help/quickref/C/Makefile.am                        |   10 -
 help/quickref/CMakeLists.txt                       |    9 +
 help/quickref/Makefile.am                          |    5 -
 help/quickref/ca/Makefile.am                       |   10 -
 help/quickref/cs/Makefile.am                       |   10 -
 help/quickref/de/Makefile.am                       |   10 -
 help/quickref/es/Makefile.am                       |   10 -
 help/quickref/fr/Makefile.am                       |   10 -
 help/quickref/hu/Makefile.am                       |   10 -
 help/quickref/it/Makefile.am                       |   10 -
 help/quickref/oc/Makefile.am                       |   10 -
 help/quickref/pl/Makefile.am                       |   10 -
 help/quickref/pt/Makefile.am                       |   10 -
 help/quickref/sq/Makefile.am                       |   10 -
 help/quickref/sv/Makefile.am                       |   10 -
 iconv-detect.c                                     |   66 +-
 libemail-engine/CMakeLists.txt                     |   94 ++
 libemail-engine/Makefile.am                        |   98 --
 libemail-engine/camel-null-store.c                 |    5 +-
 libemail-engine/camel-sasl-oauth2-google.c         |    4 +-
 libemail-engine/camel-sasl-xoauth2.c               |    3 +-
 libemail-engine/e-mail-folder-utils.c              |    6 +-
 libemail-engine/e-mail-session-utils.c             |    6 +-
 libemail-engine/e-mail-session.c                   |    4 +-
 libemail-engine/e-mail-store-utils.c               |    4 +-
 libemail-engine/em-filter-folder-element.c         |    4 +-
 libemail-engine/em-vfolder-context.c               |    4 +-
 libemail-engine/em-vfolder-rule.c                  |    4 +-
 libemail-engine/libemail-engine.pc.in              |   13 +-
 libemail-engine/mail-config.c                      |    4 +-
 libemail-engine/mail-folder-cache.c                |    4 +-
 libemail-engine/mail-mt.c                          |    4 +-
 libemail-engine/mail-ops.c                         |    6 +-
 libemail-engine/mail-tools.c                       |    4 +-
 libemail-engine/mail-vfolder.c                     |    4 +-
 libgnomecanvas/CMakeLists.txt                      |   71 +
 libgnomecanvas/Makefile.am                         |   63 -
 libgnomecanvas/gailcanvas.c                        |    4 +-
 libgnomecanvas/gailcanvasgroup.c                   |    4 +-
 libgnomecanvas/gailcanvasgroupfactory.c            |    4 +-
 libgnomecanvas/gailcanvasitem.c                    |    4 +-
 libgnomecanvas/gailcanvasitemfactory.c             |    4 +-
 libgnomecanvas/gailcanvastext.c                    |    4 +-
 libgnomecanvas/gailcanvastextfactory.c             |    4 +-
 libgnomecanvas/gailcanvaswidget.c                  |    4 +-
 libgnomecanvas/gailcanvaswidgetfactory.c           |    4 +-
 libgnomecanvas/gnome-canvas-pixbuf.c               |    4 +-
 libgnomecanvas/gnome-canvas-rect.c                 |    4 +-
 libgnomecanvas/gnome-canvas-text.c                 |    4 +-
 libgnomecanvas/gnome-canvas-util.c                 |    4 +-
 libgnomecanvas/gnome-canvas-widget.c               |    4 +-
 libgnomecanvas/gnome-canvas.c                      |    4 +-
 m4/Makefile.am                                     |    1 -
 m4/as-ac-expand.m4                                 |   50 -
 m4/as-compiler-flag.m4                             |   61 -
 m4/behave-installed-tests.m4                       |  137 --
 m4/evo_check_langinfo.m4                           |   25 -
 m4/evo_ldap_check.m4                               |   92 --
 m4/evo_purify_support.m4                           |   23 -
 m4/evo_sunldap_check.m4                            |   94 --
 mail/CMakeLists.txt                                |  297 ++++
 mail/Makefile.am                                   |  313 ----
 mail/default/C/Makefile.am                         |    9 -
 mail/default/CMakeLists.txt                        |    9 +
 mail/default/Makefile.am                           |    6 -
 mail/default/ca/Makefile.am                        |    9 -
 mail/default/cs/Makefile.am                        |    9 -
 mail/default/de/Makefile.am                        |    9 -
 mail/default/es/Makefile.am                        |    9 -
 mail/default/fi/Makefile.am                        |    9 -
 mail/default/fr/Makefile.am                        |    9 -
 mail/default/hu/Makefile.am                        |    9 -
 mail/default/id/Makefile.am                        |    9 -
 mail/default/it/Makefile.am                        |    9 -
 mail/default/ja/Makefile.am                        |    9 -
 mail/default/ko/Makefile.am                        |    9 -
 mail/default/lt/Makefile.am                        |    9 -
 mail/default/mk/Makefile.am                        |    9 -
 mail/default/nl/Makefile.am                        |    9 -
 mail/default/pl/Makefile.am                        |    9 -
 mail/default/pt/Makefile.am                        |    9 -
 mail/default/ro/Makefile.am                        |    9 -
 mail/default/sr/Makefile.am                        |    9 -
 mail/default/sr@latin/Makefile.am                  |    9 -
 mail/default/sv/Makefile.am                        |    9 -
 mail/default/zh_CN/Makefile.am                     |    9 -
 mail/e-cid-request.c                               |    4 +-
 mail/e-http-request.c                              |    4 +-
 mail/e-mail-account-manager.c                      |    7 +-
 mail/e-mail-account-store.c                        |    7 +-
 mail/e-mail-account-tree-view.c                    |    5 +-
 mail/e-mail-autoconfig.c                           |    5 +-
 mail/e-mail-backend.c                              |    4 +-
 mail/e-mail-browser.c                              |    4 +-
 mail/e-mail-config-assistant.c                     |   21 +-
 mail/e-mail-config-auth-check.c                    |    3 +-
 mail/e-mail-config-confirm-page.c                  |    5 +-
 mail/e-mail-config-defaults-page.c                 |    3 +-
 mail/e-mail-config-identity-page.c                 |    4 +-
 mail/e-mail-config-lookup-page.c                   |    5 +-
 mail/e-mail-config-page.c                          |    5 +-
 mail/e-mail-config-provider-page.c                 |    5 +-
 mail/e-mail-config-receiving-page.c                |    5 +-
 mail/e-mail-config-security-page.c                 |   21 +-
 mail/e-mail-config-sending-page.c                  |    5 +-
 mail/e-mail-config-service-page.c                  |    9 +-
 mail/e-mail-config-summary-page.c                  |    5 +-
 mail/e-mail-config-welcome-page.c                  |    5 +-
 mail/e-mail-config-window.c                        |    9 +-
 mail/e-mail-display.c                              |    7 +-
 mail/e-mail-folder-create-dialog.c                 |    5 +-
 mail/e-mail-folder-pane.c                          |    4 +-
 mail/e-mail-free-form-exp.c                        |    4 +-
 mail/e-mail-junk-options.c                         |    5 +-
 mail/e-mail-label-action.c                         |    4 +-
 mail/e-mail-label-dialog.c                         |    4 +-
 mail/e-mail-label-list-store.c                     |    4 +-
 mail/e-mail-label-manager.c                        |    4 +-
 mail/e-mail-label-tree-view.c                      |    4 +-
 mail/e-mail-message-pane.c                         |    4 +-
 mail/e-mail-migrate.c                              |    4 +-
 mail/e-mail-notes.c                                |    4 +-
 mail/e-mail-paned-view.c                           |    5 +-
 mail/e-mail-print-config-headers.c                 |    5 +-
 mail/e-mail-printer.c                              |    4 +-
 mail/e-mail-properties.c                           |    4 +-
 mail/e-mail-reader-utils.c                         |    4 +-
 mail/e-mail-reader.c                               |    4 +-
 mail/e-mail-remote-content.c                       |    4 +-
 mail/e-mail-request.c                              |    4 +-
 mail/e-mail-send-account-override.c                |    5 +-
 mail/e-mail-sidebar.c                              |    7 +-
 mail/e-mail-tag-editor.c                           |    4 +-
 mail/e-mail-ui-session.c                           |    4 +-
 mail/e-mail-view.c                                 |    4 +-
 mail/em-composer-utils.c                           |    4 +-
 mail/em-config.c                                   |    4 +-
 mail/em-event.c                                    |    4 +-
 mail/em-filter-context.c                           |    4 +-
 mail/em-filter-editor-folder-element.c             |    9 +-
 mail/em-filter-editor.c                            |    4 +-
 mail/em-filter-rule.c                              |    4 +-
 mail/em-filter-source-element.c                    |    5 +-
 mail/em-folder-properties.c                        |    4 +-
 mail/em-folder-selection-button.c                  |    5 +-
 mail/em-folder-selector.c                          |    5 +-
 mail/em-folder-tree-model.c                        |    5 +-
 mail/em-folder-tree.c                              |    5 +-
 mail/em-folder-utils.c                             |    5 +-
 mail/em-search-context.c                           |    4 +-
 mail/em-subscription-editor.c                      |    4 +-
 mail/em-utils.c                                    |    5 +-
 mail/em-vfolder-editor-context.c                   |    4 +-
 mail/em-vfolder-editor-rule.c                      |    5 +-
 mail/em-vfolder-editor.c                           |    4 +-
 mail/importers/CMakeLists.txt                      |   56 +
 mail/importers/Makefile.am                         |   36 -
 mail/importers/elm-importer.c                      |    3 +-
 mail/importers/evolution-mbox-importer.c           |    3 +-
 mail/importers/kmail-importer.c                    |    4 +-
 mail/importers/kmail-libs.c                        |    4 +-
 mail/importers/mail-importer.c                     |    7 +-
 mail/importers/pine-importer.c                     |    3 +-
 mail/mail-autofilter.c                             |    3 +-
 mail/mail-send-recv.c                              |    5 +-
 mail/mail-vfolder-ui.c                             |    5 +-
 mail/message-list.c                                |    5 +-
 mail/test-mail-autoconfig.c                        |    2 +
 maint/CMakeLists.txt                               |   52 +
 maint/Makefile.am                                  |   24 -
 maint/gladeevolution.c                             |   19 +
 marshal.mk                                         |    7 -
 modules/CMakeLists.txt                             |  140 ++
 modules/Makefile.am                                |   61 -
 modules/addressbook/CMakeLists.txt                 |   67 +
 modules/addressbook/Makefile.am                    |   91 --
 modules/addressbook/autocompletion-config.c        |    3 +-
 modules/addressbook/e-book-config-hook.c           |    4 +-
 modules/addressbook/e-book-shell-backend.c         |    4 +-
 modules/addressbook/e-book-shell-content.c         |    4 +-
 modules/addressbook/e-book-shell-migrate.c         |    4 +-
 modules/addressbook/e-book-shell-sidebar.c         |    4 +-
 modules/addressbook/e-book-shell-view-actions.c    |   10 +-
 modules/addressbook/e-book-shell-view-private.c    |    4 +-
 modules/addressbook/e-book-shell-view.c            |    4 +-
 modules/addressbook/eab-composer-util.c            |    4 +-
 modules/addressbook/evolution-module-addressbook.c |    4 +-
 modules/backup-restore/CMakeLists.txt              |   79 +
 modules/backup-restore/Makefile.am                 |   82 -
 .../backup-restore/e-mail-config-restore-page.c    |    5 +-
 .../e-mail-config-restore-ready-page.c             |    5 +-
 modules/backup-restore/evolution-backup-restore.c  |    3 +-
 modules/backup-restore/evolution-backup-tool.c     |    4 +-
 modules/bogofilter/CMakeLists.txt                  |   23 +
 modules/bogofilter/Makefile.am                     |   35 -
 modules/bogofilter/evolution-bogofilter.c          |    4 +-
 modules/book-config-google/CMakeLists.txt          |   17 +
 modules/book-config-google/Makefile.am             |   24 -
 .../evolution-book-config-google.c                 |    3 +-
 modules/book-config-ldap/CMakeLists.txt            |   23 +
 modules/book-config-ldap/Makefile.am               |   26 -
 .../book-config-ldap/evolution-book-config-ldap.c  |    3 +-
 modules/book-config-local/CMakeLists.txt           |   17 +
 modules/book-config-local/Makefile.am              |   24 -
 .../evolution-book-config-local.c                  |    3 +-
 modules/book-config-webdav/CMakeLists.txt          |   17 +
 modules/book-config-webdav/Makefile.am             |   26 -
 .../evolution-book-config-webdav.c                 |    3 +-
 modules/cal-config-caldav/CMakeLists.txt           |   17 +
 modules/cal-config-caldav/Makefile.am              |   26 -
 .../evolution-cal-config-caldav.c                  |    3 +-
 modules/cal-config-contacts/CMakeLists.txt         |   19 +
 modules/cal-config-contacts/Makefile.am            |   26 -
 modules/cal-config-contacts/e-contacts-selector.c  |    4 +-
 .../evolution-cal-config-contacts.c                |    3 +-
 modules/cal-config-google/CMakeLists.txt           |   22 +
 modules/cal-config-google/Makefile.am              |   29 -
 modules/cal-config-google/e-cal-config-google.c    |    3 +-
 modules/cal-config-google/e-cal-config-gtasks.c    |    4 +-
 .../cal-config-google/e-google-chooser-button.c    |    5 +-
 .../cal-config-google/module-cal-config-google.c   |    4 +-
 modules/cal-config-local/CMakeLists.txt            |   17 +
 modules/cal-config-local/Makefile.am               |   24 -
 .../cal-config-local/evolution-cal-config-local.c  |    3 +-
 modules/cal-config-weather/CMakeLists.txt          |   23 +
 modules/cal-config-weather/Makefile.am             |   26 -
 .../evolution-cal-config-weather.c                 |    3 +-
 modules/cal-config-webcal/CMakeLists.txt           |   17 +
 modules/cal-config-webcal/Makefile.am              |   24 -
 .../evolution-cal-config-webcal.c                  |    3 +-
 modules/calendar/CMakeLists.txt                    |   87 +
 modules/calendar/Makefile.am                       |   93 --
 modules/calendar/e-cal-attachment-handler.c        |    4 +-
 modules/calendar/e-cal-base-shell-backend.c        |    4 +-
 modules/calendar/e-cal-base-shell-content.c        |    4 +-
 modules/calendar/e-cal-base-shell-sidebar.c        |    4 +-
 modules/calendar/e-cal-base-shell-view.c           |    4 +-
 modules/calendar/e-cal-config-hook.c               |    4 +-
 modules/calendar/e-cal-event-hook.c                |    4 +-
 modules/calendar/e-cal-shell-backend.c             |    4 +-
 modules/calendar/e-cal-shell-content.c             |    4 +-
 modules/calendar/e-cal-shell-migrate.c             |    4 +-
 modules/calendar/e-cal-shell-view-actions.c        |    4 +-
 modules/calendar/e-cal-shell-view-memopad.c        |    4 +-
 modules/calendar/e-cal-shell-view-private.c        |    4 +-
 modules/calendar/e-cal-shell-view-taskpad.c        |    4 +-
 modules/calendar/e-cal-shell-view.c                |    4 +-
 modules/calendar/e-calendar-preferences.c          |    4 +-
 modules/calendar/e-memo-shell-backend.c            |    4 +-
 modules/calendar/e-memo-shell-content.c            |    4 +-
 modules/calendar/e-memo-shell-migrate.c            |    4 +-
 modules/calendar/e-memo-shell-view-actions.c       |    4 +-
 modules/calendar/e-memo-shell-view-private.c       |    4 +-
 modules/calendar/e-memo-shell-view.c               |    4 +-
 modules/calendar/e-task-shell-backend.c            |    4 +-
 modules/calendar/e-task-shell-content.c            |    4 +-
 modules/calendar/e-task-shell-migrate.c            |    4 +-
 modules/calendar/e-task-shell-view-actions.c       |    4 +-
 modules/calendar/e-task-shell-view-private.c       |    4 +-
 modules/calendar/e-task-shell-view.c               |    4 +-
 modules/calendar/evolution-module-calendar.c       |    4 +-
 modules/composer-autosave/CMakeLists.txt           |   26 +
 modules/composer-autosave/Makefile.am              |   32 -
 modules/composer-autosave/e-autosave-utils.c       |    4 +-
 modules/composer-autosave/e-composer-autosave.c    |    4 +-
 modules/composer-autosave/e-composer-registry.c    |    5 +-
 modules/contact-photos/CMakeLists.txt              |   21 +
 modules/contact-photos/Makefile.am                 |   29 -
 modules/gravatar/CMakeLists.txt                    |   21 +
 modules/gravatar/Makefile.am                       |   29 -
 modules/itip-formatter/CMakeLists.txt              |   36 +
 modules/itip-formatter/Makefile.am                 |   53 -
 modules/itip-formatter/e-mail-formatter-itip.c     |    8 +-
 modules/itip-formatter/e-mail-parser-itip.c        |    4 +-
 modules/itip-formatter/e-mail-part-itip.c          |    4 +-
 modules/itip-formatter/itip-view.c                 |    4 +-
 .../itip-formatter/web-extension/CMakeLists.txt    |   20 +
 modules/itip-formatter/web-extension/Makefile.am   |   26 -
 modules/mail-config/CMakeLists.txt                 |   30 +
 modules/mail-config/Makefile.am                    |   39 -
 modules/mail-config/e-mail-config-google-summary.c |    5 +-
 modules/mail-config/e-mail-config-local-accounts.c |    3 +-
 .../mail-config/e-mail-config-remote-accounts.c    |    3 +-
 .../mail-config/e-mail-config-sendmail-backend.c   |    4 +-
 modules/mail-config/e-mail-config-smtp-backend.c   |    5 +-
 modules/mail-config/e-mail-config-yahoo-summary.c  |    5 +-
 modules/mail/CMakeLists.txt                        |   48 +
 modules/mail/Makefile.am                           |   59 -
 modules/mail/e-mail-attachment-handler.c           |    4 +-
 modules/mail/e-mail-config-hook.c                  |    4 +-
 modules/mail/e-mail-event-hook.c                   |    4 +-
 modules/mail/e-mail-shell-backend.c                |    4 +-
 modules/mail/e-mail-shell-content.c                |    4 +-
 modules/mail/e-mail-shell-sidebar.c                |    4 +-
 modules/mail/e-mail-shell-view-actions.c           |    4 +-
 modules/mail/e-mail-shell-view-private.c           |    4 +-
 modules/mail/e-mail-shell-view.c                   |    4 +-
 modules/mail/em-account-prefs.c                    |    4 +-
 modules/mail/em-composer-prefs.c                   |    4 +-
 modules/mail/em-mailer-prefs.c                     |    4 +-
 modules/mail/evolution-module-mail.c               |    4 +-
 modules/mailto-handler/CMakeLists.txt              |   19 +
 modules/mailto-handler/Makefile.am                 |   25 -
 modules/mailto-handler/evolution-mailto-handler.c  |    4 +-
 modules/mdn/CMakeLists.txt                         |   23 +
 modules/mdn/Makefile.am                            |   37 -
 modules/mdn/evolution-mdn.c                        |    5 +-
 modules/offline-alert/CMakeLists.txt               |   21 +
 modules/offline-alert/Makefile.am                  |   35 -
 modules/offline-alert/evolution-offline-alert.c    |    4 +-
 modules/plugin-lib/CMakeLists.txt                  |   22 +
 modules/plugin-lib/Makefile.am                     |   29 -
 modules/plugin-lib/e-plugin-lib.c                  |    4 +-
 modules/plugin-lib/evolution-module-plugin-lib.c   |    4 +-
 modules/plugin-manager/CMakeLists.txt              |   19 +
 modules/plugin-manager/Makefile.am                 |   25 -
 modules/plugin-manager/evolution-plugin-manager.c  |    4 +-
 modules/prefer-plain/CMakeLists.txt                |   27 +
 modules/prefer-plain/Makefile.am                   |   34 -
 .../e-mail-display-popup-prefer-plain.c            |    4 +-
 modules/prefer-plain/e-mail-parser-prefer-plain.c  |    4 +-
 .../prefer-plain/evolution-module-prefer-plain.c   |    4 +-
 modules/prefer-plain/plugin/CMakeLists.txt         |   44 +
 modules/prefer-plain/plugin/Makefile.am            |   33 -
 modules/prefer-plain/plugin/config-ui.c            |    4 +-
 modules/settings/CMakeLists.txt                    |   61 +
 modules/settings/Makefile.am                       |   70 -
 modules/settings/e-settings-cal-model.c            |    4 +-
 modules/settings/e-settings-calendar-item.c        |    4 +-
 modules/settings/e-settings-calendar-view.c        |    4 +-
 modules/settings/e-settings-client-cache.c         |    2 +-
 modules/settings/e-settings-content-editor.c       |    4 +-
 modules/settings/e-settings-date-edit.c            |    4 +-
 modules/settings/e-settings-mail-formatter.c       |    4 +-
 modules/settings/e-settings-mail-reader.c          |    4 +-
 modules/settings/e-settings-meeting-store.c        |    4 +-
 .../settings/e-settings-meeting-time-selector.c    |    4 +-
 modules/settings/e-settings-name-selector-entry.c  |    4 +-
 modules/settings/e-settings-weekday-chooser.c      |    4 +-
 modules/spamassassin/CMakeLists.txt                |   23 +
 modules/spamassassin/Makefile.am                   |   37 -
 modules/spamassassin/evolution-spamassassin.c      |    3 +-
 modules/startup-wizard/CMakeLists.txt              |   28 +
 modules/startup-wizard/Makefile.am                 |   38 -
 modules/startup-wizard/e-mail-config-import-page.c |    5 +-
 .../e-mail-config-import-progress-page.c           |    5 +-
 modules/startup-wizard/e-startup-assistant.c       |    5 +-
 modules/startup-wizard/evolution-startup-wizard.c  |    4 +-
 modules/text-highlight/CMakeLists.txt              |   29 +
 modules/text-highlight/Makefile.am                 |   36 -
 .../e-mail-display-popup-text-highlight.c          |    4 +-
 .../e-mail-formatter-text-highlight.c              |    4 +-
 .../text-highlight/e-mail-parser-text-highlight.c  |    4 +-
 modules/text-highlight/languages.c                 |    4 +-
 modules/tnef-attachment/CMakeLists.txt             |   24 +
 modules/tnef-attachment/Makefile.am                |   36 -
 .../e-mail-parser-tnef-attachment.c                |    4 +-
 modules/vcard-inline/CMakeLists.txt                |   29 +
 modules/vcard-inline/Makefile.am                   |   35 -
 modules/vcard-inline/e-mail-formatter-vcard.c      |    4 +-
 modules/vcard-inline/e-mail-parser-vcard.c         |    4 +-
 modules/vcard-inline/e-mail-part-vcard.c           |    5 +-
 modules/webkit-editor/CMakeLists.txt               |   25 +
 modules/webkit-editor/Makefile.am                  |   31 -
 modules/webkit-editor/e-webkit-editor-extension.c  |    4 +-
 modules/webkit-editor/e-webkit-editor.c            |    4 +-
 .../webkit-editor/evolution-module-webkit-editor.c |    4 +-
 modules/webkit-editor/web-extension/CMakeLists.txt |   30 +
 modules/webkit-editor/web-extension/Makefile.am    |   38 -
 .../web-extension/e-composer-dom-functions.c       |    4 +-
 .../web-extension/e-dialogs-dom-functions.c        |    4 +-
 .../web-extension/e-editor-dom-functions.c         |    4 +-
 .../webkit-editor/web-extension/e-editor-page.c    |    4 +-
 .../web-extension/e-editor-undo-redo-manager.c     |    4 +-
 .../web-extension/e-editor-web-extension-main.c    |    4 +-
 .../web-extension/e-editor-web-extension.c         |    4 +-
 modules/webkit-inspector/CMakeLists.txt            |   17 +
 modules/webkit-inspector/Makefile.am               |   24 -
 .../webkit-inspector/evolution-webkit-inspector.c  |    3 +-
 plugin.mk                                          |   11 -
 plugins/CMakeLists.txt                             |    3 +
 plugins/Makefile.am                                |    4 -
 plugins/attachment-reminder/CMakeLists.txt         |   50 +
 plugins/attachment-reminder/Makefile.am            |   45 -
 plugins/attachment-reminder/attachment-reminder.c  |    4 +-
 plugins/bbdb/CMakeLists.txt                        |   52 +
 plugins/bbdb/Makefile.am                           |   43 -
 plugins/bbdb/bbdb.c                                |    4 +-
 plugins/bbdb/gaimbuddies.c                         |    4 +-
 plugins/dbx-import/CMakeLists.txt                  |   47 +
 plugins/dbx-import/Makefile.am                     |   42 -
 plugins/dbx-import/dbx-importer.c                  |    6 +-
 plugins/email-custom-header/CMakeLists.txt         |   54 +
 plugins/email-custom-header/Makefile.am            |   45 -
 plugins/email-custom-header/email-custom-header.c  |    4 +-
 plugins/external-editor/CMakeLists.txt             |   50 +
 plugins/external-editor/Makefile.am                |   60 -
 plugins/external-editor/external-editor.c          |    4 +-
 plugins/face/CMakeLists.txt                        |   50 +
 plugins/face/Makefile.am                           |   44 -
 plugins/face/face.c                                |    4 +-
 plugins/mail-notification/CMakeLists.txt           |   53 +
 plugins/mail-notification/Makefile.am              |   46 -
 plugins/mail-notification/mail-notification.c      |    4 +-
 plugins/mail-to-task/CMakeLists.txt                |   49 +
 plugins/mail-to-task/Makefile.am                   |   36 -
 plugins/mail-to-task/mail-to-task.c                |    4 +-
 plugins/mailing-list-actions/CMakeLists.txt        |   51 +
 plugins/mailing-list-actions/Makefile.am           |   43 -
 .../mailing-list-actions/mailing-list-actions.c    |    4 +-
 plugins/pst-import/CMakeLists.txt                  |   51 +
 plugins/pst-import/Makefile.am                     |   51 -
 plugins/pst-import/pst-importer.c                  |    6 +-
 plugins/publish-calendar/CMakeLists.txt            |   61 +
 plugins/publish-calendar/Makefile.am               |   51 -
 plugins/publish-calendar/publish-calendar.c        |    4 +-
 plugins/publish-calendar/publish-format-fb.c       |    4 +-
 plugins/publish-calendar/publish-format-ical.c     |    4 +-
 plugins/publish-calendar/publish-location.c        |    4 +-
 plugins/publish-calendar/url-editor-dialog.c       |    4 +-
 plugins/save-calendar/CMakeLists.txt               |   49 +
 plugins/save-calendar/Makefile.am                  |   36 -
 plugins/save-calendar/csv-format.c                 |    4 +-
 plugins/save-calendar/ical-format.c                |    4 +-
 plugins/save-calendar/rdf-format.c                 |    6 +-
 plugins/save-calendar/save-calendar.c              |    4 +-
 plugins/templates/CMakeLists.txt                   |   50 +
 plugins/templates/Makefile.am                      |   40 -
 plugins/templates/e-templates-store.c              |    4 +-
 plugins/templates/templates.c                      |    4 +-
 po/CMakeLists.txt                                  |    1 +
 shell/CMakeLists.txt                               |  221 +++
 shell/Makefile.am                                  |  213 ---
 shell/e-convert-local-mail.c                       |    4 +-
 shell/e-shell-backend.c                            |    4 +-
 shell/e-shell-content.c                            |    4 +-
 shell/e-shell-migrate.c                            |    4 +-
 shell/e-shell-searchbar.c                          |    4 +-
 shell/e-shell-sidebar.c                            |    4 +-
 shell/e-shell-switcher.c                           |    4 +-
 shell/e-shell-taskbar.c                            |    6 +-
 shell/e-shell-utils.c                              |    4 +-
 shell/e-shell-view.c                               |    4 +-
 shell/e-shell-window-actions.c                     |    4 +-
 shell/e-shell-window-private.c                     |    4 +-
 shell/e-shell-window-private.h                     |   14 +-
 shell/e-shell-window.c                             |    4 +-
 shell/e-shell.c                                    |    4 +-
 shell/evo-version.h.in                             |    6 +-
 shell/killev.c                                     |   24 +-
 shell/main.c                                       |   10 +-
 smime/CMakeLists.txt                               |    2 +
 smime/Makefile.am                                  |    3 -
 smime/gui/CMakeLists.txt                           |   61 +
 smime/gui/Makefile.am                              |   53 -
 smime/gui/ca-trust-dialog.c                        |    4 +-
 smime/gui/cert-trust-dialog.c                      |    4 +-
 smime/gui/certificate-manager.c                    |    4 +-
 smime/gui/component.c                              |    4 +-
 smime/gui/e-cert-selector.c                        |    4 +-
 smime/lib/CMakeLists.txt                           |   52 +
 smime/lib/Makefile.am                              |   40 -
 smime/lib/e-cert-db.c                              |    5 +-
 smime/lib/e-cert-trust.c                           |    5 +-
 smime/lib/e-cert.c                                 |    5 +-
 smime/lib/e-pkcs12.c                               |    5 +-
 smime/tests/Makefile.am                            |   22 -
 sounds/CMakeLists.txt                              |    3 +
 sounds/Makefile.am                                 |    7 -
 stamp.h.in                                         |    1 -
 tests/CMakeLists.txt                               |   10 +
 ui/CMakeLists.txt                                  |    9 +
 ui/Makefile.am                                     |   12 -
 views/CMakeLists.txt                               |    5 +
 views/Makefile.am                                  |    3 -
 views/addressbook/CMakeLists.txt                   |    6 +
 views/addressbook/Makefile.am                      |    5 -
 views/calendar/CMakeLists.txt                      |    4 +
 views/calendar/Makefile.am                         |    7 -
 views/mail/CMakeLists.txt                          |   11 +
 views/mail/Makefile.am                             |    5 -
 views/memos/CMakeLists.txt                         |    4 +
 views/memos/Makefile.am                            |    5 -
 views/tasks/CMakeLists.txt                         |    6 +
 views/tasks/Makefile.am                            |    5 -
 web-extensions/CMakeLists.txt                      |   92 ++
 web-extensions/Makefile.am                         |   45 -
 web-extensions/e-dom-utils.c                       |    4 +-
 web-extensions/e-web-extension-main.c              |    4 +-
 web-extensions/e-web-extension.c                   |    4 +-
 991 files changed, 9166 insertions(+), 11084 deletions(-)
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e449d05
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+build
+_build
+.build
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ddbb161
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,701 @@
+# Evolution build script
+
+cmake_minimum_required(VERSION 3.0)
+cmake_policy(VERSION 3.0)
+
+project(evolution
+       VERSION 3.23.1
+       LANGUAGES C CXX)
+set(PROJECT_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=Evolution";)
+set(PROJECT_URL "http://wiki.gnome.org/Apps/Evolution/";)
+
+# Base Version: This is for API/version tracking for things like
+# D-Bus server files. This should always be the major/minor of
+# the stable version or stable version to be.
+set(BASE_VERSION 3.24)
+
+# Used for pkg-config files
+set(INTERFACE_VERSION 3.0)
+
+math(EXPR _is_devel_version "${PROJECT_VERSION_MINOR}%2")
+if(_is_devel_version EQUAL 1)
+       math(EXPR _minor "${PROJECT_VERSION_MINOR}-1")
+       if(_minor EQUAL -1)
+               set(_minor 98)
+               math(EXPR _major "${PROJECT_VERSION_MAJOR}-1")
+       else(_minor EQUAL -1)
+               set(_major ${PROJECT_VERSION_MAJOR})
+       endif(_minor EQUAL -1)
+
+       set(STABLE_VERSION "${_major}.${_minor}")
+else(_is_devel_version EQUAL 1)
+       unset(STABLE_VERSION)
+endif(_is_devel_version EQUAL 1)
+
+# Required for FindIntltool module
+set(GETTEXT_PACKAGE ${PROJECT_NAME}-${BASE_VERSION})
+set(GETTEXT_PO_DIR ${CMAKE_SOURCE_DIR}/po)
+
+# Required for 'disttest' and 'ditcheck' of DistTarget module
+set(PROJECT_DISTCONFIGURE_PARAMS
+       -DENABLE_GTK_DOC=ON
+       -DENABLE_CONTACT_MAPS=ON
+       -DENABLE_INSTALLED_TESTS=ON
+       -DWITH_HELP=ON
+       -DWITH_GLADE_CATALOG=ON
+)
+
+# Keep these two definitions in agreement.
+set(glib_minimum_version 2.46)
+set(glib_encoded_version GLIB_VERSION_2_46)
+
+# Keep these two definitions in agreement.
+set(gdk_minimum_version 3.10)
+set(gdk_encoded_version GDK_VERSION_3_10)
+
+# Keep these two definitions in agreement.
+set(soup_minimum_version 2.42)
+set(soup_encoded_version SOUP_VERSION_2_42)
+
+# Warn about API usage that violates our minimum requirements.
+add_definitions(-DGLIB_VERSION_MAX_ALLOWED=${glib_encoded_version})
+add_definitions(-DGDK_VERSION_MAX_ALLOWED=${gdk_encoded_version})
+add_definitions(-DSOUP_VERSION_MAX_ALLOWED=${soup_encoded_version})
+
+# These will suppress warnings about newly-deprecated symbols. Ideally
+# these settings should match our minimum requirements and we will clean
+# up any new deprecation warnings after bumping our minimum requirements.
+# But if the warnings get to be overwhelming, use fixed versions instead.
+add_definitions(-DGLIB_VERSION_MIN_REQUIRED=${glib_encoded_version})
+add_definitions(-DGDK_VERSION_MIN_REQUIRED=${gdk_encoded_version})
+add_definitions(-DSOUP_VERSION_MIN_REQUIRED=${soup_encoded_version})
+
+set(eds_minimum_version ${PROJECT_VERSION})
+set(enchant_minimum_version 1.1.7)
+set(gcr_minimum_version 3.4)
+set(gdk_pixbuf_minimum_version 2.24.0)
+set(gnome_desktop_minimum_version 2.91.3)
+set(gsettings_desktop_schemas_minimum_version 2.91.92)
+set(libpst_minimum_version 0.6.54)
+set(libxml_minimum_version 2.7.3)
+set(shared_mime_info_minimum_version 0.22)
+set(webkit2gtk_minimum_version 2.13.90)
+
+# Optional Packages
+set(champlain_minimum_version 0.12)
+set(clutter_gtk_minimum_version 0.90)
+set(geocode_glib_minimum_version 3.10)
+set(gladeui_minimum_version 3.10.0)
+set(gnome_autoar_minimum_version 0.1.1)
+set(gweather_minimum_version 3.10)
+set(libcanberra_gtk_minimum_version 0.25)
+set(libnotify_minimum_version 0.7)
+
+# Load modules from the source tree
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_SKIP_BUILD_RPATH OFF)
+set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
+# CMAKE_INSTALL_RPATH is set below
+
+# CMake modules
+include(CheckCCompilerFlag)
+include(CheckCSourceCompiles)
+include(CheckCSourceRuns)
+include(CheckFunctionExists)
+include(CheckIncludeFile)
+include(CheckLibraryExists)
+
+# Project custom modules
+include(PrintableOptions)
+
+add_printable_variable(LIB_SUFFIX "Library directory suffix, usually defined to '64' for x86_64 systems" "")
+add_printable_variable_bare(CMAKE_INSTALL_PREFIX)
+add_printable_variable_path(BIN_INSTALL_DIR "Install directory for binary files, defaults to 
CMAKE_INSTALL_PREFIX/bin" "${CMAKE_INSTALL_PREFIX}/bin")
+add_printable_variable_path(INCLUDE_INSTALL_DIR "Install directory for header files, defaults to 
CMAKE_INSTALL_PREFIX/include" "${CMAKE_INSTALL_PREFIX}/include")
+add_printable_variable_path(LIB_INSTALL_DIR "Install directory for library files, defaults to 
CMAKE_INSTALL_PREFIX/lib{LIB_SUFFIX}" "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+add_printable_variable_path(LIBEXEC_INSTALL_DIR "Install directory for library executable files, defaults to 
CMAKE_INSTALL_PREFIX/libexec" "${CMAKE_INSTALL_PREFIX}/libexec")
+add_printable_variable_path(SHARE_INSTALL_DIR "Install directory for shared files, defaults to 
CMAKE_INSTALL_PREFIX/share" "${CMAKE_INSTALL_PREFIX}/share")
+add_printable_variable_path(LOCALE_INSTALL_DIR "Install directory for locale files, defaults to 
SHARE_INSTALL_DIR/locale" "${SHARE_INSTALL_DIR}/locale")
+add_printable_variable_path(SYSCONF_INSTALL_DIR "Install directory for system configuration files, defaults 
to CMAKE_INSTALL_PREFIX/etc" "${CMAKE_INSTALL_PREFIX}/etc")
+
+# ******************************
+# Special directories
+# ******************************
+
+# If you add something here, consider whether or not you also
+# need to add it to one or more .pc.in files (for Connector, etc)
+
+set(privdatadir "${SHARE_INSTALL_DIR}/${PROJECT_NAME}")
+set(privincludedir "${INCLUDE_INSTALL_DIR}/${PROJECT_NAME}")
+set(privlibdir "${LIB_INSTALL_DIR}/${PROJECT_NAME}")
+set(privlibexecdir "${LIBEXEC_INSTALL_DIR}/${PROJECT_NAME}")
+
+SET(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}:${privlibdir}")
+
+if(WIN32)
+       # On Win32 there is no "rpath" mechanism. We install the private
+       # shared libraries in $libdir, meaning the DLLs will actually be in
+       # $bindir. This means just having $bindir in PATH will be enough.
+       set(privsolibdir "${LIB_INSTALL_DIR}")
+else(WIN32)
+       set(privsolibdir "${privlibdir}")
+endif(WIN32)
+
+set(errordir "${privdatadir}/errors")
+set(etspecdir "${privdatadir}/etspec")
+set(evolutionhelpdir "${privdatadir}/help")
+set(icondir "${privdatadir}/icons")
+set(imagesdir "${privdatadir}/images")
+set(moduledir "${privlibdir}/modules")
+set(plugindir "${privlibdir}/plugins")
+set(soundsdir "${privdatadir}/sounds")
+set(uidir "${privdatadir}/ui")
+set(viewsdir "${privdatadir}/views")
+set(webextensionsdir "${privlibdir}/web-extensions")
+set(webextensionswebkiteditordir "${webextensionsdir}/webkit-editor")
+
+# ******************************
+# Dependencies
+# ******************************
+
+include(CodeCoverageGCOV)
+include(CheckTarget)
+include(DistTargets)
+include(EvolutionMacros)
+include(GLibTools)
+include(GtkDoc)
+include(IconCache)
+include(InstalledTests)
+include(PkgConfigEx)
+include(SetupBuildFlags)
+include(UninstallTarget)
+
+include(FindIntltool)
+include(FindLDAP)
+include(FindSMIME)
+
+add_printable_option(ENABLE_MAINTAINER_MODE "Enable maintainer mode" OFF)
+add_printable_variable(VERSION_SUBSTRING "Version substring, for packagers" "")
+add_printable_variable(VERSION_COMMENT "Define if you want a comment appended to the version number" "")
+
+if(ENABLE_MAINTAINER_MODE)
+       set(BUILD_TESTING ON)
+endif(ENABLE_MAINTAINER_MODE)
+
+# Setup compiler/linker flags
+setup_build_flags(${ENABLE_MAINTAINER_MODE})
+
+set(MATH_LDFLAGS -lm)
+
+CHECK_INCLUDE_FILE(sys/wait.h HAVE_SYS_WAIT_H)
+CHECK_INCLUDE_FILE(X11/XF86keysym.h HAVE_XFREE)
+CHECK_FUNCTION_EXISTS(mkdtemp HAVE_MKDTEMP)
+CHECK_FUNCTION_EXISTS(nl_langinfo HAVE_NL_LANGINFO)
+
+# ******************************
+# executables
+# ******************************
+
+find_program(KILL_PROCESS_COMMAND killall)
+if(NOT KILL_PROCESS_COMMAND)
+       find_program(KILL_PROCESS_COMMAND pkill)
+endif(NOT KILL_PROCESS_COMMAND)
+
+if(NOT KILL_PROCESS_COMMAND)
+       message(WARNING "Could not find a command to kill a process by name")
+endif(NOT KILL_PROCESS_COMMAND)
+
+# ******************************
+# Check for nl_langinfo features
+# ******************************
+
+CHECK_C_SOURCE_COMPILES("#include <langinfo.h>
+                       int main(void) { char *detail = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT); return 0; 
}" HAVE__NL_MEASUREMENT_MEASUREMENT)
+
+# ******************************
+# Dependencies
+# ******************************
+
+if(WIN32)
+       set(GIO_UNIX_REQUIREMENT "gio-windows-2.0")
+else(WIN32)
+       set(GIO_UNIX_REQUIREMENT "gio-unix-2.0")
+endif(WIN32)
+
+add_printable_option(ENABLE_GNOME_DESKTOP "Enable GNOME desktop dependency for thumbnails" ON)
+
+if(ENABLE_GNOME_DESKTOP)
+       set(GNOME_DESKTOP_DEPENDENCY "gnome-desktop-3.0")
+       set(HAVE_GNOME_DESKTOP ON)
+
+       # It's checked for it twice, this one gives a hint to disable the dependency if not found
+       pkg_check_modules_for_option(ENABLE_GNOME_DESKTOP "GNOME desktop dependency for thumbnails" 
GNOME_DESKTOP ${GNOME_DESKTOP_DEPENDENCY}>=${gnome_desktop_minimum_version})
+else(ENABLE_GNOME_DESKTOP)
+       set(GNOME_DESKTOP_DEPENDENCY "")
+       set(HAVE_GNOME_DESKTOP OFF)
+endif(ENABLE_GNOME_DESKTOP)
+
+pkg_check_modules(GNOME_PLATFORM
+       cairo-gobject
+       gail-3.0>=${gdk_minimum_version}
+       gcr-3>=${gcr_minimum_version}
+       gdk-pixbuf-2.0>=${gdk_pixbuf_minimum_version}
+       gio-2.0>=${glib_minimum_version}
+       ${GIO_UNIX_REQUIREMENT}
+       gmodule-2.0>=${glib_minimum_version}
+       ${GNOME_DESKTOP_DEPENDENCY}
+       gsettings-desktop-schemas>=${gsettings_desktop_schemas_minimum_version}
+       gtk+-3.0>=${gdk_minimum_version}
+       libxml-2.0>=${libxml_minimum_version}
+       shared-mime-info>=${shared_mime_info_minimum_version}
+       webkit2gtk-4.0>=${webkit2gtk_minimum_version}
+)
+
+pkg_check_modules(EVOLUTION_DATA_SERVER
+       camel-1.2>=${eds_minimum_version}
+       libebook-1.2>=${eds_minimum_version}
+       libecal-1.2>=${eds_minimum_version}
+       libedataserver-1.2>=${eds_minimum_version}
+       libedataserverui-1.2>=${eds_minimum_version}
+       libebackend-1.2>=${eds_minimum_version}
+)
+
+pkg_check_modules(A11Y atk)
+pkg_check_modules(ENCHANT enchant>=${enchant_minimum_version})
+pkg_check_modules(LIBSOUP libsoup-2.4>=${soup_minimum_version})
+pkg_check_modules(WEB_EXTENSION webkit2gtk-4.0>=${webkit2gtk_minimum_version})
+
+# ******************************
+# Canberra / Canberra-GTK Sound
+# ******************************
+
+add_printable_option(ENABLE_CANBERRA "Enable Canberra and Canberra-GTK sound" ON)
+
+if(ENABLE_CANBERRA)
+       pkg_check_modules_for_option(ENABLE_CANBERRA "Canberra and Canberra-GTK sound" CANBERRA 
libcanberra-gtk3>=${libcanberra_gtk_minimum_version})
+       set(HAVE_CANBERRA ON)
+endif(ENABLE_CANBERRA)
+
+# ******************************
+# Archives Integration / gnome-autoar
+# ******************************
+
+add_printable_option(ENABLE_AUTOAR "Enable archives support in attachments" ON)
+
+if(ENABLE_AUTOAR)
+       pkg_check_modules_for_option(ENABLE_AUTOAR "archives support in attachments" AUTOAR
+               gnome-autoar-0>=${gnome_autoar_minimum_version}
+               gnome-autoar-gtk-0>=${gnome_autoar_minimum_version}
+       )
+       set(HAVE_AUTOAR ON)
+endif(ENABLE_AUTOAR)
+
+# ******************************
+# User Documentation
+# ******************************
+
+add_printable_option(WITH_HELP "Build user documentation" ON)
+
+if(WITH_HELP)
+       find_program(ITSTOOL itstool)
+       if(NOT ITSTOOL)
+               message(FATAL_ERROR "Cannot find itstool, either install it or disable help build by adding 
-DWITH_HELP=OFF argument to cmake command")
+       endif(NOT ITSTOOL)
+endif(WITH_HELP)
+
+# ******************************
+# iconv checking
+# ******************************
+
+set(CMAKE_REQUIRED_LIBRARIES "-liconv")
+CHECK_C_SOURCE_COMPILES("#include <iconv.h>
+                       #include <stdlib.h>
+                       int main(void) { iconv_t cd; cd = iconv_open (\"UTF-8\", \"ISO-8859-1\"); return 0; 
}" HAVE_LIBICONV)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+if(HAVE_LIBICONV)
+       set(ICONV_LIBS "-liconv")
+       set(HAVE_ICONV ON)
+else(HAVE_LIBICONV)
+       set(ICONV_LIBS "")
+       CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV)
+endif(HAVE_LIBICONV)
+
+if(NOT HAVE_ICONV)
+       message(FATAL_ERROR "You need to install a working iconv implementation, such as 
ftp://ftp.gnu.org/pub/gnu/libiconv";)
+endif(NOT HAVE_ICONV)
+
+set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBS})
+CHECK_C_SOURCE_RUNS("#include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+if(NOT _correct_iconv)
+       message(FATAL_ERROR "You need to install a working iconv implementation, such as 
ftp://ftp.gnu.org/pub/gnu/libiconv";)
+endif(NOT _correct_iconv)
+
+# ******************************
+# Timezone checks
+# ******************************
+
+CHECK_C_SOURCE_COMPILES("#include <time.h>
+                       int main(void) { struct tm tm; tm.tm_gmtoff = 1; return 0; }" HAVE_TM_GMTOFF)
+
+CHECK_C_SOURCE_COMPILES("#include <time.h>
+                       int main(void) { timezone = 1; return 0; }" HAVE_TIMEZONE)
+
+CHECK_C_SOURCE_COMPILES("#include <time.h>
+                       int main(void) { altzone = 1; return 0; }" HAVE_ALTZONE)
+
+if((NOT HAVE_TM_GMTOFF) AND (NOT HAVE_TIMEZONE))
+       message(FATAL_ERROR "Unable to find a way to determine timezone")
+endif((NOT HAVE_TM_GMTOFF) AND (NOT HAVE_TIMEZONE))
+
+# ******************************
+# iso-codes
+# ******************************
+
+pkg_check_exists(HAVE_ISO_CODES iso-codes)
+if(HAVE_ISO_CODES)
+       pkg_check_at_least_version(HAVE_ISO_CODES iso-codes 0.49)
+       if(HAVE_ISO_CODES)
+               pkg_check_variable(_iso_codes_domains iso-codes domains)
+               if(NOT ((_iso_codes_domains MATCHES "639") AND (_iso_codes_domains MATCHES "3166")))
+                       message(WARNING "iso-codes detected, but either iso-639 or iso-3166 domains not found 
in '${_iso_codes_domains}'")
+                       set(HAVE_ISO_CODES OFF)
+               else()
+                       pkg_check_variable(ISO_CODES_PREFIX iso-codes prefix)
+               endif()
+       else(HAVE_ISO_CODES)
+               set(HAVE_ISO_CODES OFF)
+               message(WARNING "iso-codes detected, but version 0.49 or later is required due to licensing")
+       endif(HAVE_ISO_CODES)
+endif(HAVE_ISO_CODES)
+
+# ******************************
+# libcryptui, aka Seahorse
+# ******************************
+
+add_printable_option(ENABLE_LIBCRYPTUI "Enable libcryptui usage" ON)
+
+if(ENABLE_LIBCRYPTUI)
+       pkg_check_modules_for_option(ENABLE_LIBCRYPTUI "libcryptui usage" LIBCRYPTUI cryptui-0.0)
+       set(HAVE_AUTOAR ON)
+endif(ENABLE_LIBCRYPTUI)
+
+# ******************************
+# TNEF implementation
+# ******************************
+
+add_printable_option(ENABLE_YTNEF "Enable yTNEF library usage" ON)
+
+if(ENABLE_YTNEF)
+       set(TNEF_LDFLAGS -lytnef)
+
+       set(CMAKE_REQUIRED_LIBRARIES ${TNEF_LDFLAGS})
+       CHECK_C_SOURCE_COMPILES("#include <stdio.h>
+                               #include <ytnef.h>
+                               int main(void) { TNEFStruct *tnef; return 0; }" HAVE_YTNEF_H)
+
+       if(NOT HAVE_YTNEF_H)
+               CHECK_C_SOURCE_COMPILES("#include <stdio.h>
+                                       #include <libytnef/ytnef.h>
+                                       int main(void) { TNEFStruct *tnef; return 0; }" HAVE_LIBYTNEF_YTNEF_H)
+       endif(NOT HAVE_YTNEF_H)
+       unset(CMAKE_REQUIRED_LIBRARIES)
+
+       if((NOT HAVE_YTNEF_H) AND (NOT HAVE_LIBYTNEF_YTNEF_H))
+               message(FATAL_ERROR "Cannot find ytnef library, either install it or disable use of it by 
adding -DENABLE_YTNEF=OFF argument to cmake command")
+       endif((NOT HAVE_YTNEF_H) AND (NOT HAVE_LIBYTNEF_YTNEF_H))
+endif(ENABLE_YTNEF)
+
+# ******************************
+# Bogofilter (spam filter)
+# ******************************
+
+add_printable_variable_path(WITH_BOGOFILTER "Enable spam filtering using Bogofilter (defaults to 
/usr/bin/bogofilter)" ON)
+
+string(LENGTH "${CMAKE_BINARY_DIR}" bindirlen)
+string(SUBSTRING "${WITH_BOGOFILTER}" 0 ${bindirlen} substr)
+string(TOUPPER "${WITH_BOGOFILTER}" optupper)
+
+set(BOGOFILTER_COMMAND "")
+if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+       set(WITH_BOGOFILTER ON)
+elseif(("${optupper}" STREQUAL "OFF") OR ("${optupper}" STREQUAL "NO"))
+       set(WITH_BOGOFILTER OFF)
+else()
+       set(BOGOFILTER_COMMAND "${WITH_BOGOFILTER}")
+       set(WITH_BOGOFILTER ON)
+endif()
+
+if(WITH_BOGOFILTER)
+       if(BOGOFILTER_COMMAND STREQUAL "")
+               set(BOGOFILTER_COMMAND "$ENV{BOGOFILTER}")
+       endif(BOGOFILTER_COMMAND STREQUAL "")
+       if(BOGOFILTER_COMMAND STREQUAL "")
+               set(BOGOFILTER_COMMAND "/usr/bin/bogofilter")
+       endif(BOGOFILTER_COMMAND STREQUAL "")
+endif(WITH_BOGOFILTER)
+
+unset(bindirlen)
+unset(substr)
+unset(optupper)
+
+# ******************************
+# SpamAssassin (spam filter)
+# ******************************
+
+add_printable_variable_path(WITH_SPAMASSASSIN "Enable spam filtering using SpamAssassin (defaults to 
/usr/bin/spamassassin)" ON)
+add_printable_variable_path(WITH_SA_LEARN "Full path command where sa-learn is located (defaults to 
/usr/bin/sa-learn)" ON)
+
+string(LENGTH "${CMAKE_BINARY_DIR}" bindirlen)
+string(SUBSTRING "${WITH_SPAMASSASSIN}" 0 ${bindirlen} substr)
+string(TOUPPER "${WITH_SPAMASSASSIN}" optupper)
+
+set(SPAMASSASSIN_COMMAND "")
+if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+       set(WITH_SPAMASSASSIN ON)
+elseif(("${optupper}" STREQUAL "OFF") OR ("${optupper}" STREQUAL "NO"))
+       set(WITH_SPAMASSASSIN OFF)
+else()
+       set(SPAMASSASSIN_COMMAND "${WITH_SPAMASSASSIN}")
+       set(WITH_SPAMASSASSIN ON)
+endif()
+
+if(WITH_SPAMASSASSIN)
+       if(SPAMASSASSIN_COMMAND STREQUAL "")
+               set(SPAMASSASSIN_COMMAND "$ENV{SPAMASSASSIN}")
+       endif(SPAMASSASSIN_COMMAND STREQUAL "")
+       if(SPAMASSASSIN_COMMAND STREQUAL "")
+               set(SPAMASSASSIN_COMMAND "/usr/bin/spamassassin")
+       endif(SPAMASSASSIN_COMMAND STREQUAL "")
+
+       string(SUBSTRING "${WITH_SA_LEARN}" 0 ${bindirlen} substr)
+       string(TOUPPER "${WITH_SA_LEARN}" optupper)
+
+       set(SA_LEARN_COMMAND "")
+       if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+               set(WITH_SA_LEARN ON)
+       elseif(("${optupper}" STREQUAL "OFF") OR ("${optupper}" STREQUAL "NO"))
+               set(WITH_SA_LEARN OFF)
+       else()
+               set(SA_LEARN_COMMAND "${WITH_SA_LEARN}")
+               set(WITH_SA_LEARN ON)
+       endif()
+
+       if(SA_LEARN_COMMAND STREQUAL "")
+               set(SA_LEARN_COMMAND "$ENV{SA_LEARN}")
+       endif(SA_LEARN_COMMAND STREQUAL "")
+       if(SA_LEARN_COMMAND STREQUAL "")
+               set(SA_LEARN_COMMAND "/usr/bin/sa-learn")
+       endif(SA_LEARN_COMMAND STREQUAL "")
+endif(WITH_SPAMASSASSIN)
+
+unset(bindirlen)
+unset(substr)
+unset(optupper)
+
+# ******************************
+# CERT_UI Flags
+# ******************************
+#
+# Here we want the Mozilla flags to go *before* the other ones,
+# especially the mozilla-nss -I flags to go before the gnutls ones,
+# as both gnutls and mozilla-nss have a header called "pkcs12.h" which is
+# included in smime/lib/e-pkcs12.c. It wants the Mozilla NSS one.
+
+set(CERT_UI_INCLUDES "${MANUAL_NSPR_INCLUDES}")
+set(CERT_UI_LIBS "${MANUAL_NSPR_LIBS}")
+
+# ******************************
+# Libnotify
+# ******************************
+
+pkg_check_modules(LIBNOTIFY libnotify>=${libnotify_minimum_version})
+set(HAVE_LIBNOTIFY ${LIBNOTIFY_FOUND})
+
+# ******************************
+# libical tweaks
+# ******************************
+
+set(CMAKE_REQUIRED_FLAGS "${EVOLUTION_DATA_SERVER_CFLAGS}")
+set(CMAKE_REQUIRED_INCLUDES "${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}")
+set(CMAKE_REQUIRED_LIBRARIES "${EVOLUTION_DATA_SERVER_LDFLAGS}")
+
+CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
+                       int main(void) {
+                               ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN);
+                               return 0;
+                       }" HAVE_ICAL_UNKNOWN_TOKEN_HANDLING)
+
+CHECK_C_SOURCE_COMPILES("#include <libical/ical.h>
+                       int main(void) {
+                               icaltzutil_set_exact_vtimezones_support (0);
+                               return 0;
+                       }" HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT)
+
+unset(CMAKE_REQUIRED_FLAGS)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+# ******************************
+# gtkspell
+# ******************************
+
+add_printable_option(ENABLE_GTKSPELL "Enable gtkspell usage" ON)
+
+if(ENABLE_GTKSPELL)
+       pkg_check_modules_for_option(ENABLE_GTKSPELL "gtkspell usage" GTKSPELL gtkspell3-3.0)
+       set(HAVE_GTKSPELL ON)
+endif(ENABLE_GTKSPELL)
+
+# ******************************
+# gnu_get_libc_version()
+# ******************************
+
+CHECK_C_SOURCE_COMPILES("#include <gnu/libc-version.h>
+                       int main(void) { const gchar *libc_version = gnu_get_libc_version (); return 0; }" 
HAVE_GNU_GET_LIBC_VERSION)
+
+# ******************************
+# Plugins
+# ******************************
+
+add_printable_variable(ENABLE_PLUGINS "Enable plugins (no/base/all)" "all")
+
+set(plugins_base
+       publish-calendar
+)
+set(plugins_standard
+       attachment-reminder
+       bbdb
+       dbx-import
+       email-custom-header
+       external-editor
+       face
+       mail-to-task
+       mailing-list-actions
+       mail-notification
+       save-calendar
+       templates
+)
+
+# ******************************************************************
+# The following plugins have additional library dependencies.
+# They must be explicitly disabled if the libraries are not present.
+# ******************************************************************
+
+# text-highlight
+
+add_printable_option(ENABLE_TEXT_HIGHLIGHT "Enable text-highlight plugin" ON)
+
+if(ENABLE_TEXT_HIGHLIGHT)
+       find_program(HIGHLIGHT_COMMAND highlight)
+
+       if(NOT HIGHLIGHT_COMMAND)
+               message(FATAL_ERROR "The 'highlight' program not found; either give it into PATH or disable 
higlight plugin with -DENABLE_TEXT_HIGHLIGHT=OFF")
+       endif(NOT HIGHLIGHT_COMMAND)
+endif(ENABLE_TEXT_HIGHLIGHT)
+
+# weather calendar
+
+add_printable_option(ENABLE_WEATHER "Enable weather calendars" ON)
+
+if(ENABLE_WEATHER)
+       pkg_check_modules_for_option(ENABLE_WEATHER "weather calendar" GWEATHER 
gweather-3.0>=${gweather_minimum_version})
+endif(ENABLE_WEATHER)
+
+# maps in Contacts preview
+
+add_printable_option(ENABLE_CONTACT_MAPS "Enable contact maps" OFF)
+
+if(ENABLE_CONTACT_MAPS)
+       pkg_check_modules_for_option(ENABLE_CONTACT_MAPS "contact maps" CHAMPLAIN 
champlain-gtk-0.12>=${champlain_minimum_version})
+       pkg_check_modules_for_option(ENABLE_CONTACT_MAPS "contact maps" GEO 
geocode-glib-1.0>=${geocode_glib_minimum_version})
+       pkg_check_modules_for_option(ENABLE_CONTACT_MAPS "contact maps" CLUTTER_GTK 
clutter-gtk-1.0>=${clutter_gtk_minimum_version})
+endif(ENABLE_CONTACT_MAPS)
+
+# pst-import plugin
+
+add_printable_option(ENABLE_PST_IMPORT "Enable pst-import plugin" ON)
+
+if(ENABLE_PST_IMPORT)
+       pkg_check_modules_for_option(ENABLE_PST_IMPORT "pst-import plugin" LIBPST 
libpst>=${libpst_minimum_version})
+       list(APPEND plugins_standard pst-import)
+endif(ENABLE_PST_IMPORT)
+
+# Finish plugins build setup
+set(build_plugins)
+
+if(ENABLE_PLUGINS STREQUAL "" OR ENABLE_PLUGINS STREQUAL "all")
+       set(build_plugins ${plugins_base} ${plugins_standard})
+elseif(ENABLE_PLUGINS STREQUAL "base")
+       set(build_plugins ${plugins_base})
+elseif(NOT ENABLE_PLUGINS STREQUAL "no")
+       message(FATAL_ERROR "Incorrect value for ENABLE_PLUGINS (${ENABLE_PLUGINS}), use either \"no\", or 
\"base\" or \"all\" value")
+endif()
+
+# ******************************
+# Glade catalog
+# ******************************
+
+add_printable_option(WITH_GLADE_CATALOG "Install the catalog files for Glade 3 (for maintainers only)" OFF)
+
+if(WITH_GLADE_CATALOG)
+       pkg_check_modules_for_option(WITH_GLADE_CATALOG "Glade 3 catalog files" GLADEUI 
gladeui-2.0>=${gladeui_minimum_version})
+endif(WITH_GLADE_CATALOG)
+
+# Generate the ${PROJECT_NAME}-config.h file
+CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-config.h)
+
+print_build_options()
+
+# The shell_private_requirements is used by the evolution-shell.pc.in
+if(ENABLE_GNOME_DESKTOP)
+       set(shell_private_requirements "Requires.private: ${GNOME_DESKTOP_DEPENDENCY}")
+else(ENABLE_GNOME_DESKTOP)
+       set(shell_private_requirements "")
+endif(ENABLE_GNOME_DESKTOP)
+
+add_pkgconfig_file(evolution-calendar.pc.in evolution-calendar-${INTERFACE_VERSION}.pc)
+add_pkgconfig_file(evolution-mail.pc.in evolution-mail-${INTERFACE_VERSION}.pc)
+add_pkgconfig_file(evolution-shell.pc.in evolution-shell-${INTERFACE_VERSION}.pc)
+
+add_appdata_file(evolution.appdata.xml.in evolution.appdata.xml)
+
+add_subdirectory(addressbook)
+add_subdirectory(art)
+add_subdirectory(calendar)
+add_subdirectory(composer)
+add_subdirectory(data)
+add_subdirectory(em-format)
+add_subdirectory(e-util)
+add_subdirectory(libemail-engine)
+add_subdirectory(libgnomecanvas)
+add_subdirectory(mail)
+add_subdirectory(modules)
+add_subdirectory(plugins)
+add_subdirectory(po)
+add_subdirectory(shell)
+add_subdirectory(sounds)
+add_subdirectory(tests)
+add_subdirectory(ui)
+add_subdirectory(views)
+add_subdirectory(web-extensions)
+
+if(ENABLE_GTK_DOC)
+       add_subdirectory(doc)
+endif(ENABLE_GTK_DOC)
+
+if(WITH_HELP)
+       add_subdirectory(help)
+endif(WITH_HELP)
+
+if(WITH_GLADE_CATALOG)
+       add_subdirectory(maint)
+endif(WITH_GLADE_CATALOG)
+
+if(ENABLE_SMIME)
+       add_subdirectory(smime)
+endif(ENABLE_SMIME)
diff --git a/README b/README
index 645cd30..9be805c 100644
--- a/README
+++ b/README
@@ -65,8 +65,8 @@ dependencies should be compiled in the order they are listed here):
           Many distributions ship these as Mozilla development
           packages.
 
-Other dependencies are claimed during the ./configure phase. If these are
-optional, also a parameter for the ./configure to not use that dependency
+Other dependencies are claimed during the configure phase. If these are
+optional, also a parameter for the CMake configure to not use that dependency
 is shown.
 
 CONFIGURING EVOLUTION
@@ -117,30 +117,33 @@ following things:
                   <servicedir>/opt/evolution/share/dbus-1/services</servicedir>
                 </busconfig>
 
-        * Pass an appropriate --prefix parameter to the configure
+        * Pass an appropriate CMAKE_INSTALL_PREFIX parameter to the configure
           scripts of Evolution and its dependencies, eg:
 
-                ./configure --prefix=/opt/evolution
-
-More information on how to use the configure script is available in
-the INSTALL file which is part of the Evolution tarball.
+                cd ..../sources/evolution
+                mkdir build
+                cd build
+                cmake -G "Unix Makefiles" \
+                      -DCMAKE_INSTALL_PREFIX=/opt/evolution \
+                      -DCMAKE_BUILD_TYPE=Release \
+                      ..
 
+        * Run `cmake --help` to get list of available generators (the -G argument)
+          on your platform.
 
 OPTIONAL FEATURES
 -----------------
 
 Some optional features can be enabled at compilation time by passing
-appropriate flags to the configure script. You can get list of all
-of the configure option by running:
-
-                ./configure --help
+appropriate flags to the CMake. These options are shown at the end
+of the successful configure phase.
 
 BUILDING EVOLUTION
 ------------------
 
 After the Evolution is properly configured, run:
 
-                make
-                make install
+                make -j
+                make -j install
 
 to build it.
diff --git a/addressbook/CMakeLists.txt b/addressbook/CMakeLists.txt
new file mode 100644
index 0000000..b611bc3
--- /dev/null
+++ b/addressbook/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_error_files(addressbook addressbook.error)
+
+add_subdirectory(gui)
+add_subdirectory(importers)
+add_subdirectory(printing)
+add_subdirectory(util)
diff --git a/addressbook/gui/CMakeLists.txt b/addressbook/gui/CMakeLists.txt
new file mode 100644
index 0000000..72e4297
--- /dev/null
+++ b/addressbook/gui/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_subdirectory(contact-editor)
+add_subdirectory(contact-list-editor)
+add_subdirectory(widgets)
diff --git a/addressbook/gui/contact-editor/CMakeLists.txt b/addressbook/gui/contact-editor/CMakeLists.txt
new file mode 100644
index 0000000..2c6cced
--- /dev/null
+++ b/addressbook/gui/contact-editor/CMakeLists.txt
@@ -0,0 +1,60 @@
+install(FILES  contact-editor.ui
+               fullname.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       eabwidgets
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       eab-editor.c
+       eab-editor.h
+       e-contact-editor.c
+       e-contact-editor.h
+       e-contact-editor-dyntable.c
+       e-contact-editor-dyntable.h
+       e-contact-editor-fullname.c
+       e-contact-editor-fullname.h
+       e-contact-quick-add.c
+       e-contact-quick-add.h
+)
+
+add_library(econtacteditor SHARED
+       ${SOURCES}
+)
+
+add_dependencies(econtacteditor
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtacteditor PRIVATE
+       -DG_LOG_DOMAIN=\"e-contact-editor\"
+)
+
+target_compile_options(econtacteditor PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtacteditor PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/addressbook
+       ${CMAKE_SOURCE_DIR}/addressbook/gui/widgets
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtacteditor
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtacteditor
+       DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c 
b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index 2754312..076365d 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c 
b/addressbook/gui/contact-editor/e-contact-editor.c
index 4704528..19b97a1 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "eab-editor.h"
 #include "e-contact-editor.h"
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c 
b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 2830508..f975083 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <string.h>
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c
index 3dd4ed5..c1ed5b0 100644
--- a/addressbook/gui/contact-editor/eab-editor.c
+++ b/addressbook/gui/contact-editor/eab-editor.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c
index f00812a..e93d410 100644
--- a/addressbook/gui/contact-editor/test-editor.c
+++ b/addressbook/gui/contact-editor/test-editor.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <gtk/gtk.h>
diff --git a/addressbook/gui/contact-list-editor/CMakeLists.txt 
b/addressbook/gui/contact-list-editor/CMakeLists.txt
new file mode 100644
index 0000000..c31e932
--- /dev/null
+++ b/addressbook/gui/contact-list-editor/CMakeLists.txt
@@ -0,0 +1,55 @@
+install(FILES contact-list-editor.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       eabutil
+       eabwidgets
+       econtacteditor
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       e-contact-list-editor.c
+       e-contact-list-editor.h
+       e-contact-list-model.c
+       e-contact-list-model.h
+)
+
+add_library(econtactlisteditor SHARED
+       ${SOURCES}
+)
+
+add_dependencies(econtactlisteditor
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtactlisteditor PRIVATE
+       -DG_LOG_DOMAIN=\"e-contact-list-editor\"
+)
+
+target_compile_options(econtactlisteditor PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtactlisteditor PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/addressbook
+       ${CMAKE_SOURCE_DIR}/addressbook/gui/widgets
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtactlisteditor
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtactlisteditor
+       DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c 
b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 4df72b2..5e00836 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-contact-list-editor.h"
 
@@ -38,8 +36,8 @@
 #include "addressbook/gui/widgets/eab-gui-util.h"
 #include "addressbook/util/eab-book-util.h"
 
-#include "eab-editor.h"
-#include "e-contact-editor.h"
+#include "addressbook/gui/contact-editor/eab-editor.h"
+#include "addressbook/gui/contact-editor/e-contact-editor.h"
 #include "e-contact-list-model.h"
 #include "eab-contact-merging.h"
 
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c 
b/addressbook/gui/contact-list-editor/e-contact-list-model.c
index e8c273c..925d28b 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/addressbook/gui/widgets/CMakeLists.txt b/addressbook/gui/widgets/CMakeLists.txt
new file mode 100644
index 0000000..18899ce
--- /dev/null
+++ b/addressbook/gui/widgets/CMakeLists.txt
@@ -0,0 +1,117 @@
+install(FILES  addresstypes.xml
+               address_formats.dat
+               countrytransl.map
+       DESTINATION ${privdatadir}
+)
+
+install(FILES e-addressbook-view.etspec
+       DESTINATION ${etspecdir}
+)
+
+set(DEPENDENCIES
+       eabutil
+       econtactprint
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       eab-config.c
+       eab-contact-compare.c
+       eab-contact-compare.h
+       eab-contact-display.c
+       eab-contact-display.h
+       eab-contact-formatter.c
+       eab-contact-formatter.h
+       eab-contact-merging.c
+       eab-contact-merging.h
+       eab-gui-util.c
+       eab-gui-util.h
+       e-contact-map.c
+       e-contact-map.h
+       e-contact-map-window.c
+       e-contact-map-window.h
+       e-minicard.c
+       e-minicard.h
+       e-minicard-label.c
+       e-minicard-label.h
+       e-minicard-view.c
+       e-minicard-view.h
+       e-minicard-view-widget.c
+       e-minicard-view-widget.h
+       e-addressbook-reflow-adapter.c
+       e-addressbook-reflow-adapter.h
+       e-addressbook-table-adapter.c
+       e-addressbook-table-adapter.h
+       e-addressbook-model.c
+       e-addressbook-model.h
+       e-addressbook-selector.c
+       e-addressbook-selector.h
+       e-addressbook-view.c
+       e-addressbook-view.h
+       gal-view-minicard.c
+       gal-view-minicard.h
+       ea-minicard.c
+       ea-minicard.h
+       ea-minicard-view.c
+       ea-minicard-view.h
+       ea-addressbook-view.c
+       ea-addressbook-view.h
+       ea-addressbook.c
+       ea-addressbook.h
+)
+
+set(HEADERS
+       eab-config.h
+)
+
+add_library(eabwidgets SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(eabwidgets
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(eabwidgets PRIVATE
+       -DG_LOG_DOMAIN=\"eabwidgets\"
+       -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(eabwidgets PUBLIC
+       ${CHAMPLAIN_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GEO_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(eabwidgets PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/addressbook
+       ${CMAKE_SOURCE_DIR}/addressbook/util
+       ${CHAMPLAIN_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GEO_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(eabwidgets
+       ${DEPENDENCIES}
+       ${CHAMPLAIN_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GEO_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS eabwidgets
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/addressbook/gui/widgets
+)
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 95fc3af..9eb38fe 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c 
b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
index a531e33..220a1d4 100644
--- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c
@@ -15,9 +15,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c 
b/addressbook/gui/widgets/e-addressbook-selector.c
index e4c18ff..80f0e2d 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -16,16 +16,14 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-addressbook-selector.h"
 
 #include <e-util/e-util.h>
 
-#include <eab-book-util.h>
-#include <eab-contact-merging.h>
+#include "util/eab-book-util.h"
+#include "eab-contact-merging.h"
 
 #define E_ADDRESSBOOK_SELECTOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c 
b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 36e71b3..3a953fa 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 463e49f..7f78faa 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <string.h>
diff --git a/addressbook/gui/widgets/e-contact-map-window.c b/addressbook/gui/widgets/e-contact-map-window.c
index 292d5f3..63103c4 100644
--- a/addressbook/gui/widgets/e-contact-map-window.c
+++ b/addressbook/gui/widgets/e-contact-map-window.c
@@ -17,12 +17,9 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-/* This defines WITH_CONTACT_MAPS. */
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 
 #include "e-contact-map-window.h"
 
@@ -505,4 +502,4 @@ e_contact_map_window_load_addressbook (EContactMapWindow *map,
        g_free (query_string);
 }
 
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
diff --git a/addressbook/gui/widgets/e-contact-map-window.h b/addressbook/gui/widgets/e-contact-map-window.h
index 9a0838a..d9ce49c 100644
--- a/addressbook/gui/widgets/e-contact-map-window.h
+++ b/addressbook/gui/widgets/e-contact-map-window.h
@@ -20,7 +20,7 @@
 #ifndef E_CONTACT_MAP_WINDOW_H
 #define E_CONTACT_MAP_WINDOW_H
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 
 #include <gtk/gtk.h>
 
@@ -75,6 +75,6 @@ void          e_contact_map_window_load_addressbook
 
 G_END_DECLS
 
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
 
 #endif /* E_CONTACT_MAP_WINDOW_H */
diff --git a/addressbook/gui/widgets/e-contact-map.c b/addressbook/gui/widgets/e-contact-map.c
index fde0e8b..3b72322 100644
--- a/addressbook/gui/widgets/e-contact-map.c
+++ b/addressbook/gui/widgets/e-contact-map.c
@@ -16,11 +16,9 @@
  * Copyright (C) 2011 Dan Vratil <dvratil redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 
 #include "e-contact-map.h"
 
@@ -490,4 +488,4 @@ e_contact_map_get_view (EContactMap *map)
        return gtk_champlain_embed_get_view (GTK_CHAMPLAIN_EMBED (map));
 }
 
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
diff --git a/addressbook/gui/widgets/e-contact-map.h b/addressbook/gui/widgets/e-contact-map.h
index cd04f7d..8ca2502 100644
--- a/addressbook/gui/widgets/e-contact-map.h
+++ b/addressbook/gui/widgets/e-contact-map.h
@@ -20,7 +20,7 @@
 #ifndef E_CONTACT_MAP_H
 #define E_CONTACT_MAP_H
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 
 #include <gtk/gtk.h>
 
@@ -90,6 +90,6 @@ ChamplainView *       e_contact_map_get_view          (EContactMap *map);
 
 G_END_DECLS
 
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
 
 #endif /* E_CONTACT_MAP_H */
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index c6d8dff..eee477c 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-minicard-label.h"
 
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c 
b/addressbook/gui/widgets/e-minicard-view-widget.c
index 4ed6161..7ca5d93 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index a7b1f61..8623294 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-minicard-view.h"
 
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 4c17ba7..95bae88 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-minicard.h"
 
diff --git a/addressbook/gui/widgets/ea-addressbook-view.c b/addressbook/gui/widgets/ea-addressbook-view.c
index f7324e5..3982458 100644
--- a/addressbook/gui/widgets/ea-addressbook-view.c
+++ b/addressbook/gui/widgets/ea-addressbook-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 #include "ea-addressbook-view.h"
diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c
index 60d78c1..91f9f07 100644
--- a/addressbook/gui/widgets/ea-addressbook.c
+++ b/addressbook/gui/widgets/ea-addressbook.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util/e-util.h"
 
diff --git a/addressbook/gui/widgets/ea-minicard-view.c b/addressbook/gui/widgets/ea-minicard-view.c
index ae130d1..d14a719 100644
--- a/addressbook/gui/widgets/ea-minicard-view.c
+++ b/addressbook/gui/widgets/ea-minicard-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/addressbook/gui/widgets/ea-minicard.c b/addressbook/gui/widgets/ea-minicard.c
index ad2e1f1..28153ca 100644
--- a/addressbook/gui/widgets/ea-minicard.c
+++ b/addressbook/gui/widgets/ea-minicard.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c
index bffc6c8..45c6417 100644
--- a/addressbook/gui/widgets/eab-config.c
+++ b/addressbook/gui/widgets/eab-config.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "eab-config.h"
 
diff --git a/addressbook/gui/widgets/eab-contact-compare.c b/addressbook/gui/widgets/eab-contact-compare.c
index 21648af..c4ac180 100644
--- a/addressbook/gui/widgets/eab-contact-compare.c
+++ b/addressbook/gui/widgets/eab-contact-compare.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <string.h>
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index 967cee7..20801ab 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "eab-contact-display.h"
 
@@ -322,7 +320,7 @@ contact_display_link_clicked (EWebView *web_view,
                link_clicked (web_view, uri);
 }
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 /* XXX Clutter event handling workaround. Clutter-gtk propagates events down
  *     to parent widgets.  In this case it leads to GtkHTML scrolling up and
  *     down while user's trying to zoom in the champlain widget. This
@@ -518,7 +516,7 @@ eab_contact_display_init (EABContactDisplay *display)
        web_view = E_WEB_VIEW (display);
        ui_manager = e_web_view_get_ui_manager (web_view);
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
        g_signal_connect (
                web_view, "create-plugin-widget",
                G_CALLBACK (contact_display_object_requested), display);
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c
index d2e217b..eaf842d 100644
--- a/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/addressbook/gui/widgets/eab-contact-formatter.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "eab-contact-formatter.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n.h>
 
@@ -26,6 +25,8 @@
 #include "eab-book-util.h"
 #include "eab-gui-util.h"
 
+#include "eab-contact-formatter.h"
+
 #define EAB_CONTACT_FORMATTER_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EAB_TYPE_CONTACT_FORMATTER, EABContactFormatterPrivate))
@@ -777,7 +778,7 @@ accum_address_map (GString *buffer,
                    EContact *contact,
                    gint map_type)
 {
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
        g_string_append (buffer, "<tr><td colspan=\"3\">");
 
        if (map_type == E_CONTACT_ADDRESS_WORK) {
@@ -793,7 +794,7 @@ accum_address_map (GString *buffer,
        }
 
        g_string_append (buffer, "</td></tr>");
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
 }
 
 static void
diff --git a/addressbook/gui/widgets/eab-contact-merging.c b/addressbook/gui/widgets/eab-contact-merging.c
index 80ce637..515e98a 100644
--- a/addressbook/gui/widgets/eab-contact-merging.c
+++ b/addressbook/gui/widgets/eab-contact-merging.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "eab-contact-merging.h"
 #include "eab-contact-compare.h"
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 2114323..cd9a0d1 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -693,7 +691,7 @@ get_locales_str (void)
 static gchar *
 country_to_ISO (const gchar *country)
 {
-       FILE *file = fopen (EVOLUTION_RULEDIR "/countrytransl.map", "r");
+       FILE *file = fopen (EVOLUTION_PRIVDATADIR "/countrytransl.map", "r");
        gchar buffer[100];
        gint length = 100;
        gchar **pair;
@@ -803,7 +801,7 @@ get_address_format (AddressFormat address_format,
 
        error = NULL;
        key_file = g_key_file_new ();
-       g_key_file_load_from_file (key_file, EVOLUTION_RULEDIR "/address_formats.dat", 0, &error);
+       g_key_file_load_from_file (key_file, EVOLUTION_PRIVDATADIR "/address_formats.dat", 0, &error);
        if (error != NULL) {
                g_warning ("%s: Failed to load address_formats.dat file: %s", G_STRFUNC, error->message);
                if (format)
diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c
index 4490dec..2e185ee 100644
--- a/addressbook/gui/widgets/gal-view-minicard.c
+++ b/addressbook/gui/widgets/gal-view-minicard.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libxml/parser.h>
 
diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h
index a8d0586..2863cfe 100644
--- a/addressbook/gui/widgets/gal-view-minicard.h
+++ b/addressbook/gui/widgets/gal-view-minicard.h
@@ -25,7 +25,7 @@
 #define GAL_VIEW_MINICARD_H
 
 #include <e-util/e-util.h>
-#include <e-minicard-view-widget.h>
+#include "e-minicard-view-widget.h"
 #include "e-addressbook-view.h"
 
 /* Standard GObject macros */
diff --git a/addressbook/importers/CMakeLists.txt b/addressbook/importers/CMakeLists.txt
new file mode 100644
index 0000000..409107d
--- /dev/null
+++ b/addressbook/importers/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(DEPENDENCIES
+       eabutil
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       evolution-ldif-importer.c
+       evolution-vcard-importer.c
+       evolution-csv-importer.c
+       evolution-addressbook-importers.h
+)
+
+add_library(evolution-addressbook-importers SHARED
+       ${SOURCES}
+)
+
+add_dependencies(evolution-addressbook-importers
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-addressbook-importers PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-addressbook-importers\"
+)
+
+target_compile_options(evolution-addressbook-importers PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-addressbook-importers PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/addressbook
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-addressbook-importers
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-addressbook-importers
+       DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c
index e98dc54..4a674cc 100644
--- a/addressbook/importers/evolution-csv-importer.c
+++ b/addressbook/importers/evolution-csv-importer.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index 2d0454d..d8d79a2 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -28,9 +28,7 @@
  * Made re-entrant, converted to eplugin, Michael Zucchi <notzed ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/addressbook/importers/evolution-vcard-importer.c 
b/addressbook/importers/evolution-vcard-importer.c
index 9903679..636d6a8 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/addressbook/printing/CMakeLists.txt b/addressbook/printing/CMakeLists.txt
new file mode 100644
index 0000000..df76cf4
--- /dev/null
+++ b/addressbook/printing/CMakeLists.txt
@@ -0,0 +1,55 @@
+set(ecpsdir ${privdatadir}/ecps)
+
+install(FILES  smallbook.ecps
+               medbook.ecps
+               phonelist.ecps
+       DESTINATION ${ecpsdir}
+)
+
+set(DEPENDENCIES
+       eabutil
+       evolution-util
+)
+
+set(SOURCES
+       e-contact-print-types.h
+       e-contact-print.c
+       e-contact-print.h
+)
+
+add_library(econtactprint SHARED
+       ${SOURCES}
+)
+
+add_dependencies(econtactprint
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(econtactprint PRIVATE
+       -DG_LOG_DOMAIN=\"addressbook-printing\"
+       -DEVOLUTION_ECPSDIR=\"${ecpsdir}\"
+)
+
+target_compile_options(econtactprint PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(econtactprint PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/addressbook
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(econtactprint
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS econtactprint
+       DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index 93ad923..352ae90 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <sys/types.h>
diff --git a/addressbook/util/CMakeLists.txt b/addressbook/util/CMakeLists.txt
new file mode 100644
index 0000000..ee49cd3
--- /dev/null
+++ b/addressbook/util/CMakeLists.txt
@@ -0,0 +1,46 @@
+set(DEPENDENCIES
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       eab-book-util.c
+       eab-book-util.h
+)
+
+add_library(eabutil SHARED
+       ${SOURCES}
+)
+
+add_dependencies(eabutil
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(eabutil PRIVATE
+       -DG_LOG_DOMAIN=\"eabutil\"
+)
+
+target_compile_options(eabutil PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(eabutil PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/shell
+       ${CMAKE_BINARY_DIR}/shell
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(eabutil
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS eabutil
+       DESTINATION ${privsolibdir}
+)
diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c
index 18c7ec0..bd6d218 100644
--- a/addressbook/util/eab-book-util.c
+++ b/addressbook/util/eab-book-util.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 #include <string.h>
diff --git a/art/CMakeLists.txt b/art/CMakeLists.txt
new file mode 100644
index 0000000..17f4d40
--- /dev/null
+++ b/art/CMakeLists.txt
@@ -0,0 +1,18 @@
+set(images
+       confidential-stamp.jpg
+       draft-paper.png
+       draft-stamp.jpg
+       midnight-stars.jpg
+       minus.png
+       paper.png
+       plus.png
+       rect.png
+       ribbon.jpg
+       texture.png
+       working.png
+       world_map-960.png
+)
+
+install(FILES ${images}
+       DESTINATION ${imagesdir}
+)
diff --git a/calendar/CMakeLists.txt b/calendar/CMakeLists.txt
new file mode 100644
index 0000000..827448f
--- /dev/null
+++ b/calendar/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_error_files(calendar calendar.error)
+
+add_subdirectory(alarm-notify)
+add_subdirectory(gui)
+add_subdirectory(importers)
diff --git a/calendar/alarm-notify/CMakeLists.txt b/calendar/alarm-notify/CMakeLists.txt
new file mode 100644
index 0000000..c8536cf
--- /dev/null
+++ b/calendar/alarm-notify/CMakeLists.txt
@@ -0,0 +1,91 @@
+install(FILES alarm-notify.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       eabutil
+       econtacteditor
+       econtactlisteditor
+       evolution-calendar
+       evolution-calendar-importers
+       evolution-mail-composer
+       evolution-mail-formatter
+       evolution-util
+       evolution-shell
+)
+
+set(SOURCES
+       alarm.c
+       alarm.h
+       alarm-notify.c
+       alarm-notify.h
+       alarm-notify-dialog.c
+       alarm-notify-dialog.h
+       alarm-queue.c
+       alarm-queue.h
+       config-data.c
+       config-data.h
+       notify-main.c
+       util.c
+       util.h
+)
+
+add_executable(evolution-alarm-notify
+       ${SOURCES}
+)
+
+add_dependencies(evolution-alarm-notify
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-alarm-notify PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-alarm-notify\"
+       -DEVOLUTION_ICONDIR=\"${icondir}\"
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+)
+
+target_compile_options(evolution-alarm-notify PUBLIC
+       ${CANBERRA_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(evolution-alarm-notify PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_BINARY_DIR}/calendar
+       ${CMAKE_SOURCE_DIR}/calendar
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CANBERRA_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-alarm-notify
+       ${DEPENDENCIES}
+       ${CANBERRA_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${LIBNOTIFY_LDFLAGS}
+)
+
+if(WIN32)
+       find_program(WINDRES windres)
+       if(WINDRES)
+               add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+                       COMMAND ${WINDRES} ${CMAKE_CURRENT_SOURCE_DIR}/evolution-alarm-notify-icon.rc 
${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+                       DEPENDS evolution-alarm-notify-icon.rc
+                               evolution-alarm-notify.ico
+               )
+
+               target_link_libraries(evolution-alarm-notify
+                       ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify-icon.o
+               )
+       endif(WINDRES)
+endif(WIN32)
+
+install(TARGETS evolution-alarm-notify
+       DESTINATION ${privlibexecdir}
+)
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c
index 84df985..a8a6d68 100644
--- a/calendar/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/alarm-notify/alarm-notify-dialog.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c
index 50621f1..616dabf 100644
--- a/calendar/alarm-notify/alarm-notify.c
+++ b/calendar/alarm-notify/alarm-notify.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <camel/camel.h>
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index 5539c5c..50a9aa3 100644
--- a/calendar/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/calendar/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c
index 64e5b7e..a4cebf6 100644
--- a/calendar/alarm-notify/alarm.c
+++ b/calendar/alarm-notify/alarm.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <unistd.h>
 #include <time.h>
diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c
index 4c0fa72..a2cc71a 100644
--- a/calendar/alarm-notify/config-data.c
+++ b/calendar/alarm-notify/config-data.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <e-util/e-util.h>
diff --git a/calendar/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c
index 26538da..c827f15 100644
--- a/calendar/alarm-notify/notify-main.c
+++ b/calendar/alarm-notify/notify-main.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <glib/gi18n.h>
diff --git a/calendar/alarm-notify/util.c b/calendar/alarm-notify/util.c
index a50b5b3..227f561 100644
--- a/calendar/alarm-notify/util.c
+++ b/calendar/alarm-notify/util.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 #include "e-util/e-util.h"
diff --git a/calendar/gui/CMakeLists.txt b/calendar/gui/CMakeLists.txt
new file mode 100644
index 0000000..18a0cb3
--- /dev/null
+++ b/calendar/gui/CMakeLists.txt
@@ -0,0 +1,218 @@
+add_custom_xml_files(calendar ${privdatadir} filter .in ""
+       tasktypes.xml
+       memotypes.xml
+       caltypes.xml
+)
+
+install(FILES  e-meeting-time-sel.etspec
+               e-cal-list-view.etspec
+               e-memo-table.etspec
+               e-task-table.etspec
+       DESTINATION ${etspecdir}
+)
+
+
+set(DEPENDENCIES
+       eabutil
+       econtacteditor
+       econtactlisteditor
+       evolution-calendar-importers
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+       gnomecanvas
+)
+
+set(SOURCES
+       calendar-config.c
+       calendar-view.c
+       comp-util.c
+       e-alarm-list.c
+       e-cal-component-preview.c
+       e-cal-config.c
+       e-cal-data-model.c
+       e-cal-data-model-subscriber.c
+       e-cal-dialogs.c
+       e-cal-event.c
+       e-cal-list-view.c
+       e-cal-model-calendar.c
+       e-cal-model.c
+       e-cal-model-memos.c
+       e-cal-model-tasks.c
+       e-cal-ops.c
+       e-calendar-view.c
+       e-cell-date-edit-text.c
+       e-comp-editor.c
+       e-comp-editor-event.c
+       e-comp-editor-memo.c
+       e-comp-editor-page-attachments.c
+       e-comp-editor-page-general.c
+       e-comp-editor-page-recurrence.c
+       e-comp-editor-page-reminders.c
+       e-comp-editor-page-schedule.c
+       e-comp-editor-page.c
+       e-comp-editor-property-part.c
+       e-comp-editor-property-parts.c
+       e-comp-editor-task.c
+       e-date-time-list.c
+       e-day-view-layout.c
+       e-day-view-main-item.c
+       e-day-view-time-item.c
+       e-day-view-top-item.c
+       e-day-view.c
+       e-meeting-attendee.c
+       e-meeting-list-view.c
+       e-meeting-store.c
+       e-meeting-time-sel.c
+       e-meeting-time-sel-item.c
+       e-meeting-utils.c
+       e-memo-table.c
+       e-month-view.c
+       e-select-names-editable.c
+       e-select-names-renderer.c
+       e-send-options-utils.c
+       e-task-table.c
+       e-week-view-event-item.c
+       e-week-view-layout.c
+       e-week-view-main-item.c
+       e-week-view-titles-item.c
+       e-week-view.c
+       e-weekday-chooser.c
+       e-timezone-entry.c
+       itip-utils.c
+       misc.c
+       print.c
+       tag-calendar.c
+       ea-calendar.c
+       ea-calendar-helpers.c
+       ea-cal-view.c
+       ea-cal-view-event.c
+       ea-day-view.c
+       ea-day-view-main-item.c
+       ea-day-view-cell.c
+       ea-week-view.c
+       ea-week-view-main-item.c
+       ea-week-view-cell.c
+       ea-jump-button.c
+)
+
+set(HEADERS
+       calendar-config.h
+       calendar-config-keys.h
+       calendar-view.h
+       comp-util.h
+       e-alarm-list.h
+       e-cal-component-preview.h
+       e-cal-config.h
+       e-cal-data-model.h
+       e-cal-data-model-subscriber.h
+       e-cal-dialogs.h
+       e-cal-event.h
+       e-cal-list-view.h
+       e-cal-model-calendar.h
+       e-cal-model.h
+       e-cal-model-memos.h
+       e-cal-model-tasks.h
+       e-cal-ops.h
+       e-calendar-view.h
+       e-cell-date-edit-text.h
+       e-comp-editor.h
+       e-comp-editor-event.h
+       e-comp-editor-memo.h
+       e-comp-editor-page-attachments.h
+       e-comp-editor-page-general.h
+       e-comp-editor-page-recurrence.h
+       e-comp-editor-page-reminders.h
+       e-comp-editor-page-schedule.h
+       e-comp-editor-page.h
+       e-comp-editor-property-part.h
+       e-comp-editor-property-parts.h
+       e-comp-editor-task.h
+       e-date-time-list.h
+       e-day-view-layout.h
+       e-day-view-main-item.h
+       e-day-view-time-item.h
+       e-day-view-top-item.h
+       e-day-view.h
+       e-meeting-attendee.h
+       e-meeting-list-view.h
+       e-meeting-store.h
+       e-meeting-time-sel.h
+       e-meeting-time-sel-item.h
+       e-meeting-types.h
+       e-meeting-utils.h
+       e-memo-table.h
+       e-month-view.h
+       e-select-names-editable.h
+       e-select-names-renderer.h
+       e-send-options-utils.h
+       e-task-table.h
+       e-week-view-event-item.h
+       e-week-view-layout.h
+       e-week-view-main-item.h
+       e-week-view-titles-item.h
+       e-week-view.h
+       e-weekday-chooser.h
+       e-timezone-entry.h
+       itip-utils.h
+       misc.h
+       print.h
+       tag-calendar.h
+       ea-calendar.h
+       ea-calendar-helpers.h
+       ea-cal-view.h
+       ea-cal-view-event.h
+       ea-day-view.h
+       ea-day-view-main-item.h
+       ea-day-view-cell.h
+       ea-week-view.h
+       ea-week-view-main-item.h
+       ea-week-view-cell.h
+       ea-jump-button.h
+)
+
+add_library(evolution-calendar SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-calendar
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-calendar PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-calendar\"
+       -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-calendar PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${LIBSOUP_CFLAGS}
+)
+
+target_include_directories(evolution-calendar PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${LIBSOUP_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-calendar
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${LIBSOUP_LDFLAGS}
+       ${MATH_LDFLAGS}
+)
+
+install(TARGETS evolution-calendar
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/calendar/gui
+)
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 0a0d238..b79784b 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -24,9 +24,7 @@
  * calendar-config.c - functions to load/save/get/set user settings.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <time.h>
 #include <string.h>
diff --git a/calendar/gui/caltypes.xml b/calendar/gui/caltypes.xml.in
similarity index 74%
rename from calendar/gui/caltypes.xml
rename to calendar/gui/caltypes.xml.in
index 964b623..81276c4 100644
--- a/calendar/gui/caltypes.xml
+++ b/calendar/gui/caltypes.xml.in
@@ -16,7 +16,7 @@
             <input type="string" name="summary"/>
         </part>
 
-        <part name="description">
+        <part name="description">
             <_title>Description</_title>
             <input type="optionlist" name="description-type">
                 <option value="contains">
@@ -55,7 +55,7 @@
        <option value="is not">
            <_title>is not</_title>
            <code>(not(contains? "classification" ${classification}))</code>
-      </option>  
+      </option>
      </input>
      <input type="optionlist" name="classification">
       <option value="Public">
@@ -67,60 +67,60 @@
       <option value="Confidential">
           <_title>Confidential</_title>
       </option>
-     </input>    
+     </input>
    </part>
 
 
        <part name="name2">
             <_title>Organizer</_title>
              <input type="optionlist" name="name-type">
-           <option value="contains">
-                 <_title>contains</_title>
-                 <code>(contains? "organizer" ${name})</code>
-            </option>
-            <option value="not contains">
-               <_title>does not contain</_title>
+               <option value="contains">
+                 <_title>contains</_title>
+                 <code>(contains? "organizer" ${name})</code>
+               </option>
+            <option value="not contains">
+               <_title>does not contain</_title>
                  <code>(not (contains? "organizer" ${name}))</code>
-            </option>
-           </input>
-           <input type="string" name="name"/>
-       </part>
+            </option>
+           </input>
+           <input type="string" name="name"/>
+       </part>
 
        <part name="name3">
-          <_title>Attendee</_title>
-            <input type="optionlist" name="name-type">
-             <option value="contains">
-                <_title>contains</_title>
-                 <code>(contains? "attendee" ${name})</code>
-            </option>
-            <option value="not contains">
+          <_title>Attendee</_title>
+            <input type="optionlist" name="name-type">
+             <option value="contains">
+                <_title>contains</_title>
+                 <code>(contains? "attendee" ${name})</code>
+            </option>
+            <option value="not contains">
                 <_title>does not contain</_title>
-                <code>(not (contains? "attendee" ${name}))</code>
-            </option>
-           </input>
-           <input type="string" name="name"/>
-        </part>
- 
+                <code>(not (contains? "attendee" ${name}))</code>
+            </option>
+           </input>
+           <input type="string" name="name"/>
+        </part>
+
        <part name="name4">
-           <_title>Location</_title>
-            <input type="optionlist" name="name-type">
+           <_title>Location</_title>
+            <input type="optionlist" name="name-type">
               <option value="contains">
-                 <_title>contains</_title>
-                 <code>(contains? "location" ${name})</code>
-            </option>
-            <option value="not contains">
-               <_title>does not contain</_title>
+                 <_title>contains</_title>
+                 <code>(contains? "location" ${name})</code>
+            </option>
+            <option value="not contains">
+               <_title>does not contain</_title>
                  <code>(not (contains? "location" ${name}))</code>
-            </option>
-           </input>
+            </option>
+           </input>
             <input type="string" name="name"/>
           </part>
 
        <part name="category">
          <_title>Category</_title>
           <input type="optionlist" name="category-type">
-               <option value="is">
-               <_title>is</_title>
+               <option value="is">
+               <_title>is</_title>
                <code>(has-categories? ${category})</code>
            </option>
            <option value="is not">
@@ -152,22 +152,22 @@
         </part>
 
        <part name="recurrences">
-        <_title>Recurrence</_title>
+        <_title>Recurrence</_title>
          <input type="optionlist" name="match-type">
-         <option value="exist">
-          <_title>Exist</_title>
-          <code>
-               (has-recurrences?)     
+         <option value="exist">
+          <_title>Exist</_title>
+          <code>
+               (has-recurrences?)
            </code>
-       </option>
-       <option value="not exist">
-         <_title>Do Not Exist</_title>
-        <code>
-         (not (has-recurrences?))
-        </code>
-        </option>
-        </input>
-       </part>
+       </option>
+       <option value="not exist">
+         <_title>Do Not Exist</_title>
+        <code>
+               (not (has-recurrences?))
+        </code>
+        </option>
+        </input>
+       </part>
 
    <part name="count-occurrences">
       <_title>Occurs</_title>
@@ -193,37 +193,37 @@
     <rule grouping="any" source="demand">
       <_title>Summary Contains</_title>
        <partset>
-               <part name="summary">
+               <part name="summary">
                  <value name="summary-type" type="option" value="contains"/>
-                 <value name="summary" type="string"/>
-               </part>        
+                 <value name="summary" type="string"/>
+               </part>
          </partset>
 
       <sources/>
     </rule>
-    
+
     <rule grouping="any" source="demand">
       <_title>Description Contains</_title>
       <partset>
                <part name="description">
-                 <value name="description-type" type="option" value="contains"/>
-                 <value name="description" type="string"/>
-               </part>        
+                 <value name="description-type" type="option" value="contains"/>
+                 <value name="description" type="string"/>
+               </part>
        </partset>
       <sources/>
     </rule>
-    
+
     <rule grouping="any" source="demand">
       <_title>Any field contains</_title>
        <partset>
-              <part name="anyfield">
-                 <value name="anyfield-type" type="option" value="contains"/>
+              <part name="anyfield">
+                 <value name="anyfield-type" type="option" value="contains"/>
                  <value name="anyfield" type="string"/>
-               </part>
+               </part>
         </partset>
       <sources/>
     </rule>
-     
+
   </ruleset>
 
   </filterdescription>
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index f37fa33..4132dba 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <time.h>
diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c
index 353b61f..61234db 100644
--- a/calendar/gui/e-alarm-list.c
+++ b/calendar/gui/e-alarm-list.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c
index 1653819..d185251 100644
--- a/calendar/gui/e-cal-component-preview.c
+++ b/calendar/gui/e-cal-component-preview.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-component-preview.h"
 
diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c
index 15fda00..9d0649f 100644
--- a/calendar/gui/e-cal-config.c
+++ b/calendar/gui/e-cal-config.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/calendar/gui/e-cal-data-model-subscriber.c b/calendar/gui/e-cal-data-model-subscriber.c
index b08b0c1..141a5cb 100644
--- a/calendar/gui/e-cal-data-model-subscriber.c
+++ b/calendar/gui/e-cal-data-model-subscriber.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-data-model-subscriber.h"
 
diff --git a/calendar/gui/e-cal-data-model.c b/calendar/gui/e-cal-data-model.c
index 9618c1c..4f83a7b 100644
--- a/calendar/gui/e-cal-data-model.c
+++ b/calendar/gui/e-cal-data-model.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-cal-dialogs.c b/calendar/gui/e-cal-dialogs.c
index 10e8de4..c1a8509 100644
--- a/calendar/gui/e-cal-dialogs.c
+++ b/calendar/gui/e-cal-dialogs.c
@@ -19,9 +19,7 @@
  *     Federico Mena-Quintero <federico ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-cal-event.c b/calendar/gui/e-cal-event.c
index 6a97248..76d914e 100644
--- a/calendar/gui/e-cal-event.c
+++ b/calendar/gui/e-cal-event.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-event.h"
 
diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c
index 1cbd114..2bd3e28 100644
--- a/calendar/gui/e-cal-list-view.c
+++ b/calendar/gui/e-cal-list-view.c
@@ -19,9 +19,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-list-view.h"
 #include "ea-calendar.h"
diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c
index e5e969a..e5dd927 100644
--- a/calendar/gui/e-cal-model-calendar.c
+++ b/calendar/gui/e-cal-model-calendar.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c
index 0b00768..f7ee2b0 100644
--- a/calendar/gui/e-cal-model-memos.c
+++ b/calendar/gui/e-cal-model-memos.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index c0649ec..02ce42f 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <string.h>
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 19c649d..89f3f82 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-cal-ops.c b/calendar/gui/e-cal-ops.c
index b66acf2..d729060 100644
--- a/calendar/gui/e-cal-ops.c
+++ b/calendar/gui/e-cal-ops.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 539e4d4..4b44c22 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <time.h>
diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c
index 103e27d..2c70434 100644
--- a/calendar/gui/e-cell-date-edit-text.c
+++ b/calendar/gui/e-cell-date-edit-text.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/time.h>
 #include <time.h>
diff --git a/calendar/gui/e-comp-editor-event.c b/calendar/gui/e-comp-editor-event.c
index 78a43dc..9e61347 100644
--- a/calendar/gui/e-comp-editor-event.c
+++ b/calendar/gui/e-comp-editor-event.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-comp-editor-memo.c b/calendar/gui/e-comp-editor-memo.c
index 2114c0d..c2bad16 100644
--- a/calendar/gui/e-comp-editor-memo.c
+++ b/calendar/gui/e-comp-editor-memo.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-comp-editor-page-attachments.c b/calendar/gui/e-comp-editor-page-attachments.c
index 5910c7a..c3400b7 100644
--- a/calendar/gui/e-comp-editor-page-attachments.c
+++ b/calendar/gui/e-comp-editor-page-attachments.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gstdio.h>
diff --git a/calendar/gui/e-comp-editor-page-general.c b/calendar/gui/e-comp-editor-page-general.c
index ab8f63a..90f763a 100644
--- a/calendar/gui/e-comp-editor-page-general.c
+++ b/calendar/gui/e-comp-editor-page-general.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-comp-editor-page-recurrence.c b/calendar/gui/e-comp-editor-page-recurrence.c
index 74621e4..7f302df 100644
--- a/calendar/gui/e-comp-editor-page-recurrence.c
+++ b/calendar/gui/e-comp-editor-page-recurrence.c
@@ -22,9 +22,7 @@
  *     Hans Petter Jansson <hpj ximiman com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-comp-editor-page-reminders.c b/calendar/gui/e-comp-editor-page-reminders.c
index 9ceb4ec..e64154d 100644
--- a/calendar/gui/e-comp-editor-page-reminders.c
+++ b/calendar/gui/e-comp-editor-page-reminders.c
@@ -22,9 +22,7 @@
  *     Hans Petter Jansson <hpj ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-comp-editor-page-schedule.c b/calendar/gui/e-comp-editor-page-schedule.c
index 728b891..dc44ea6 100644
--- a/calendar/gui/e-comp-editor-page-schedule.c
+++ b/calendar/gui/e-comp-editor-page-schedule.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-comp-editor-page.c b/calendar/gui/e-comp-editor-page.c
index 8cf9fb5..018d21b 100644
--- a/calendar/gui/e-comp-editor-page.c
+++ b/calendar/gui/e-comp-editor-page.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-comp-editor-property-part.c b/calendar/gui/e-comp-editor-property-part.c
index 80fbe0c..2a872df 100644
--- a/calendar/gui/e-comp-editor-property-part.c
+++ b/calendar/gui/e-comp-editor-property-part.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-comp-editor-property-parts.c b/calendar/gui/e-comp-editor-property-parts.c
index 066b738..adbec6d 100644
--- a/calendar/gui/e-comp-editor-property-parts.c
+++ b/calendar/gui/e-comp-editor-property-parts.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/e-comp-editor-task.c b/calendar/gui/e-comp-editor-task.c
index 90f8917..2f155eb 100644
--- a/calendar/gui/e-comp-editor-task.c
+++ b/calendar/gui/e-comp-editor-task.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-comp-editor.c b/calendar/gui/e-comp-editor.c
index c33f9e6..3c2d570 100644
--- a/calendar/gui/e-comp-editor.c
+++ b/calendar/gui/e-comp-editor.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c
index 47f9ab5..681e0a2 100644
--- a/calendar/gui/e-date-time-list.c
+++ b/calendar/gui/e-date-time-list.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-date-time-list.h"
 
diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c
index c891242..65405b0 100644
--- a/calendar/gui/e-day-view-layout.c
+++ b/calendar/gui/e-day-view-layout.c
@@ -25,9 +25,7 @@
  * used for printing.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-day-view-layout.h"
 
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index 5f6ee1f..a0bca0e 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -24,9 +24,7 @@
  * data in the main Day/Work Week display.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-day-view-main-item.h"
 
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
index f2bafbd..6af16b6 100644
--- a/calendar/gui/e-day-view-time-item.c
+++ b/calendar/gui/e-day-view-time-item.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 74fedd6..58a8aa6 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -23,9 +23,7 @@
  * EDayViewTopItem - displays the top part of the Day/Work Week calendar view.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 555319a..aec869b 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -21,9 +21,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-day-view.h"
 
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index 525e499..abca018 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 63755f4..08d0037 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index 5bd652f..ae2012b 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gio/gio.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c
index f220182..dfc3874 100644
--- a/calendar/gui/e-meeting-time-sel-item.c
+++ b/calendar/gui/e-meeting-time-sel-item.c
@@ -22,9 +22,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <time.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index bd8a4bc..847818f 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-meeting-time-sel.h"
 
diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c
index 4726673..e7df2f8 100644
--- a/calendar/gui/e-meeting-utils.c
+++ b/calendar/gui/e-meeting-utils.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <libedataserver/libedataserver.h>
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index f4309ee..71922da 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -25,9 +25,7 @@
  * EMemoTable - displays the ECalComponent objects in a table (an ETable).
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-memo-table.h"
 
diff --git a/calendar/gui/e-month-view.c b/calendar/gui/e-month-view.c
index 265d974..6c45c42 100644
--- a/calendar/gui/e-month-view.c
+++ b/calendar/gui/e-month-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-month-view.h"
 
diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c
index e0bb7b1..d57e7ce 100644
--- a/calendar/gui/e-select-names-editable.c
+++ b/calendar/gui/e-select-names-editable.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c
index 1be7aef..03bdc44 100644
--- a/calendar/gui/e-select-names-renderer.c
+++ b/calendar/gui/e-select-names-renderer.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-select-names-editable.h"
 #include "e-select-names-renderer.h"
diff --git a/calendar/gui/e-send-options-utils.c b/calendar/gui/e-send-options-utils.c
index 6afef2f..122af98 100644
--- a/calendar/gui/e-send-options-utils.c
+++ b/calendar/gui/e-send-options-utils.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-send-options-utils.h"
 
diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c
index 2216e06..5160893 100644
--- a/calendar/gui/e-task-table.c
+++ b/calendar/gui/e-task-table.c
@@ -24,9 +24,7 @@
  * ETaskTable - displays the ECalComponent objects in a table (an ETable).
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-task-table.h"
 
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index 3dd84b5..3757528 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -27,9 +27,7 @@
  * timezone.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-timezone-entry.h"
 
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index dadd940..ffde31b 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -25,9 +25,7 @@
  * edit the text.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-week-view-event-item.h"
 
diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c
index ca64930..818765f 100644
--- a/calendar/gui/e-week-view-layout.c
+++ b/calendar/gui/e-week-view-layout.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-week-view-layout.h"
 #include "calendar-config.h"
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index cf69529..82ddf4e 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c
index 23a41be..746c2a3 100644
--- a/calendar/gui/e-week-view-titles-item.c
+++ b/calendar/gui/e-week-view-titles-item.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <e-util/e-util.h>
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index ec9b695..c7e5789 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -24,9 +24,7 @@
  * EWeekView - displays the Week & Month views of the calendar.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-week-view.h"
 
diff --git a/calendar/gui/e-weekday-chooser.c b/calendar/gui/e-weekday-chooser.c
index 3e4d1b7..eb49d1d 100644
--- a/calendar/gui/e-weekday-chooser.c
+++ b/calendar/gui/e-weekday-chooser.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-weekday-chooser.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <gtk/gtk.h>
@@ -27,6 +26,8 @@
 #include <libgnomecanvas/libgnomecanvas.h>
 #include <e-util/e-util.h>
 
+#include "e-weekday-chooser.h"
+
 #define PADDING 2
 
 #define E_WEEKDAY_CHOOSER_GET_PRIVATE(obj) \
diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c
index 1c915cd..6ab80cb 100644
--- a/calendar/gui/ea-cal-view-event.c
+++ b/calendar/gui/ea-cal-view-event.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c
index 3c0d238..5af10ba 100644
--- a/calendar/gui/ea-cal-view.c
+++ b/calendar/gui/ea-cal-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-cal-view.h"
 #include "ea-calendar-helpers.h"
diff --git a/calendar/gui/ea-calendar-helpers.c b/calendar/gui/ea-calendar-helpers.c
index a60751d..f45b4bd 100644
--- a/calendar/gui/ea-calendar-helpers.c
+++ b/calendar/gui/ea-calendar-helpers.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-calendar-helpers.h"
 #include "ea-cal-view-event.h"
diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c
index ce80773..c994644 100644
--- a/calendar/gui/ea-calendar.c
+++ b/calendar/gui/ea-calendar.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libgnomecanvas/libgnomecanvas.h>
 
diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c
index ee9d4e6..aac4f22 100644
--- a/calendar/gui/ea-day-view-cell.c
+++ b/calendar/gui/ea-day-view-cell.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-day-view-cell.h"
 #include "ea-day-view-main-item.h"
diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c
index ecd8a5f..00e8cd2 100644
--- a/calendar/gui/ea-day-view-main-item.c
+++ b/calendar/gui/ea-day-view-main-item.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c
index 3331148..1022c01 100644
--- a/calendar/gui/ea-day-view.c
+++ b/calendar/gui/ea-day-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-day-view.h"
 #include "ea-cal-view-event.h"
diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c
index d3176b0..bc5f86b 100644
--- a/calendar/gui/ea-jump-button.c
+++ b/calendar/gui/ea-jump-button.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-jump-button.h"
 #include "ea-calendar-helpers.h"
diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c
index 19f076b..f5747dd 100644
--- a/calendar/gui/ea-week-view-cell.c
+++ b/calendar/gui/ea-week-view-cell.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-week-view-cell.h"
 #include "ea-week-view-main-item.h"
diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c
index d70e7ef..7002b01 100644
--- a/calendar/gui/ea-week-view-main-item.c
+++ b/calendar/gui/ea-week-view-main-item.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-week-view-main-item.h"
 
diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c
index 45ce69a..3f292d7 100644
--- a/calendar/gui/ea-week-view.c
+++ b/calendar/gui/ea-week-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-week-view.h"
 
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index c873e99..49464e5 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <time.h>
 #include <glib/gi18n-lib.h>
diff --git a/calendar/gui/memotypes.xml b/calendar/gui/memotypes.xml.in
similarity index 84%
rename from calendar/gui/memotypes.xml
rename to calendar/gui/memotypes.xml.in
index 1872461..268d9a0 100644
--- a/calendar/gui/memotypes.xml
+++ b/calendar/gui/memotypes.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <filterdescription>
 <partset>
-       <part name="summary">
+       <part name="summary">
             <_title>Summary</_title>
             <input type="optionlist" name="summary-type">
                 <option value="contains">
@@ -15,7 +15,7 @@
             </input>
             <input type="string" name="summary"/>
         </part>
-       
+
        <part name="description">
             <_title>Description</_title>
             <input type="optionlist" name="description-type">
@@ -47,19 +47,19 @@
         </part>
 
        <part name="name2">
-         <_title>Organizer</_title>
-           <input type="optionlist" name="name-type">
-            <option value="contains">
-                <_title>contains</_title>
-                 <code>(contains? "organizer" ${name})</code>
-            </option>
+         <_title>Organizer</_title>
+           <input type="optionlist" name="name-type">
+            <option value="contains">
+                <_title>contains</_title>
+                 <code>(contains? "organizer" ${name})</code>
+            </option>
              <option value="not contains">
-               <_title>does not contain</_title>
+               <_title>does not contain</_title>
                  <code>(not (contains? "organizer" ${name}))</code>
-            </option>
-        </input>
-          <input type="string" name="name"/>
-        </part>
+            </option>
+        </input>
+          <input type="string" name="name"/>
+        </part>
 
 <part name="name2">
      <_title>Classification</_title>
@@ -83,9 +83,9 @@
       <option value="Confidential">
           <_title>Confidential</_title>
       </option>
-     </input>   
+     </input>
    </part>
- 
+
  <part name="category">
   <_title>Category</_title>
    <input type="optionlist" name="category-type">
@@ -110,7 +110,6 @@
     <_title>Exist</_title>
     <code>
        (has-attachments?)
-     
     </code>
    </option>
    <option value="not exist">
@@ -122,7 +121,6 @@
   </input>
  </part>
 
- 
 </partset>
 
 <ruleset>
@@ -130,36 +128,36 @@
     <rule grouping="any" source="demand">
       <_title>Summary Contains</_title>
        <partset>
-               <part name="summary">
+               <part name="summary">
                  <value name="summary-type" type="option" value="contains"/>
-                 <value name="summary" type="string"/>
-               </part>        
+                 <value name="summary" type="string"/>
+               </part>
          </partset>
       <sources/>
     </rule>
-    
+
     <rule grouping="any" source="demand">
       <_title>Description Contains</_title>
        <partset>
                <part name="description">
-                 <value name="description-type" type="option" value="contains"/>
+                 <value name="description-type" type="option" value="contains"/>
                  <value name="description" type="string"/>
-               </part>        
+               </part>
        </partset>
       <sources/>
     </rule>
-    
+
     <rule grouping="any" source="demand">
       <_title>Any field contains</_title>
        <partset>
-              <part name="anyfield">
-                 <value name="anyfield-type" type="option" value="contains"/>
+              <part name="anyfield">
+                 <value name="anyfield-type" type="option" value="contains"/>
                  <value name="anyfield" type="string"/>
-               </part>
+               </part>
         </partset>
       <sources/>
     </rule>
-     
+
   </ruleset>
 
   </filterdescription>
diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c
index eba20be..ba4c52e 100644
--- a/calendar/gui/misc.c
+++ b/calendar/gui/misc.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <time.h>
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index dac6bdb..49276b9 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "print.h"
 
diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c
index e507aa9..b5563be 100644
--- a/calendar/gui/tag-calendar.c
+++ b/calendar/gui/tag-calendar.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "shell/e-shell.h"
 #include "calendar-config.h"
diff --git a/calendar/gui/tasktypes.xml b/calendar/gui/tasktypes.xml.in
similarity index 95%
rename from calendar/gui/tasktypes.xml
rename to calendar/gui/tasktypes.xml.in
index cd9876b..ba31840 100644
--- a/calendar/gui/tasktypes.xml
+++ b/calendar/gui/tasktypes.xml.in
@@ -41,7 +41,7 @@
                      <option value="not contains">
                           <_title>does not contain</_title>
                          <code>(not (contains? "organizer" ${name}))</code>
-                     </option> 
+                     </option>
             </input>
             <input type="string" name="name"/>
        </part>
@@ -57,7 +57,7 @@
                           <_title>does not contain</_title>
                           <code>(not (contains? "attendee" ${name}))</code>
                      </option>
-            </input>
+            </input>
             <input type="string" name="name"/>
        </part>
 
@@ -205,10 +205,10 @@
         <rule grouping="any" source="demand">
             <_title>Summary Contains</_title>
         <partset>
-               <part name="summary">
+               <part name="summary">
                  <value name="summary-type" type="option" value="contains"/>
-                 <value name="summary" type="string"/>
-               </part>        
+                 <value name="summary" type="string"/>
+               </part>
          </partset>
 
             <sources/>
@@ -218,9 +218,9 @@
             <_title>Description Contains</_title>
        <partset>
                <part name="description">
-                 <value name="description-type" type="option" value="contains"/>
+                 <value name="description-type" type="option" value="contains"/>
                  <value name="description" type="string"/>
-               </part>        
+               </part>
        </partset>
 
             <sources/>
@@ -229,10 +229,10 @@
         <rule grouping="any" source="demand">
             <_title>Any field contains</_title>
        <partset>
-              <part name="anyfield">
-                 <value name="anyfield-type" type="option" value="contains"/>
+               <part name="anyfield">
+                 <value name="anyfield-type" type="option" value="contains"/>
                  <value name="anyfield" type="string"/>
-               </part>
+               </part>
         </partset>
 
             <sources/>
diff --git a/calendar/importers/CMakeLists.txt b/calendar/importers/CMakeLists.txt
new file mode 100644
index 0000000..f6eb91f
--- /dev/null
+++ b/calendar/importers/CMakeLists.txt
@@ -0,0 +1,47 @@
+set(DEPENDENCIES
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       evolution-calendar-importer.h
+       icalendar-importer.c
+)
+
+add_library(evolution-calendar-importers SHARED
+       ${SOURCES}
+)
+
+add_dependencies(evolution-calendar-importers
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-calendar-importers PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-calendar-importers\"
+       -DEVOLUTION_SOUNDDIR=\"${soundsdir}\"
+)
+
+target_compile_options(evolution-calendar-importers PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-calendar-importers PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_BINARY_DIR}/calendar
+       ${CMAKE_SOURCE_DIR}/calendar
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-calendar-importers
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-calendar-importers
+       DESTINATION ${privsolibdir}
+)
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index af47264..9044678 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..2037e36
--- /dev/null
+++ b/cmake/cmake_uninstall.cmake.in
@@ -0,0 +1,21 @@
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+  message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+  message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
+  if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+    exec_program(
+      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      OUTPUT_VARIABLE rm_out
+      RETURN_VALUE rm_retval
+      )
+    if(NOT "${rm_retval}" STREQUAL 0)
+      message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
+    endif(NOT "${rm_retval}" STREQUAL 0)
+  else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+    message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
+  endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
diff --git a/cmake/modules/CheckTarget.cmake b/cmake/modules/CheckTarget.cmake
new file mode 100644
index 0000000..71824a9
--- /dev/null
+++ b/cmake/modules/CheckTarget.cmake
@@ -0,0 +1,21 @@
+# CheckTarget.cmake
+#
+# Defines a custom target 'check', which gathers test programs like 'make check'
+# This is taken from https://cmake.org/Wiki/CMakeEmulateMakeCheck
+#
+# What you do is to call command:
+# add_check_test(_name)
+#   where _name is the name of the test, as defined by add_executable().
+#   Note it is a good idea to use EXCLUDE_FROM_ALL within the add_executable().
+
+include(CTest)
+
+# Disable this to not have verbose tests
+set(CMAKE_CTEST_COMMAND ${CMAKE_CTEST_COMMAND} -V)
+
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
+
+macro(add_check_test _name)
+       add_test(NAME ${_name} COMMAND ${_name})
+       add_dependencies(check ${_name})
+endmacro(add_check_test)
diff --git a/cmake/modules/CodeCoverageGCOV.cmake b/cmake/modules/CodeCoverageGCOV.cmake
new file mode 100644
index 0000000..bf670e0
--- /dev/null
+++ b/cmake/modules/CodeCoverageGCOV.cmake
@@ -0,0 +1,45 @@
+# CodeCoverageGCOV.cmake
+#
+# Adds options ENABLE_CODE_COVERAGE, which builds the project with
+# code coverage support
+#
+# It sets variables:
+# CODE_COVERAGE_DEFINES - to be used with target_compile_definitions() and similar
+# CODE_COVERAGE_CFLAGS - to be used with target_compile_options() and similar for C code
+# CODE_COVERAGE_CXXFLAGS - to be used with target_compile_options() and similar for C++ code
+# CODE_COVERAGE_LDFLAGS - to be used with target_link_libraries() and similar
+#
+# These variables should be added as the last in the options, because they change compilation
+
+include(CheckLibraryExists)
+include(PrintableOptions)
+
+add_printable_option(ENABLE_CODE_COVERAGE "Enable build with GCOV code coverage" OFF)
+
+if(ENABLE_CODE_COVERAGE)
+       if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+               CHECK_LIBRARY_EXISTS("gcov" "gcov_exit" "" HAVE_GCOV_LIBRARY)
+               if(HAVE_GCOV_LIBRARY)
+                       set(CODE_COVERAGE_CFLAGS "-O0 -g -fprofile-arcs -ftest-coverage")
+                       set(CODE_COVERAGE_LDFLAGS "-lgcov")
+
+                       add_definitions(-DNDEBUG)
+                       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CODE_COVERAGE_CFLAGS}")
+                       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CODE_COVERAGE_CFLAGS}")
+                       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CODE_COVERAGE_LDFLAGS}")
+                       set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CODE_COVERAGE_LDFLAGS}")
+                       set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CODE_COVERAGE_LDFLAGS}")
+                       set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${CODE_COVERAGE_LDFLAGS}")
+               else(HAVE_GCOV_LIBRARY)
+                       message(FATAL_ERROR "Cannot fing gcov library, use -DENABLE_CODE_COVERAGE=OFF disable 
it")
+               endif(HAVE_GCOV_LIBRARY)
+
+       else("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+               message(FATAL_ERROR "Code coverage requires gcc compiler, use -DENABLE_CODE_COVERAGE=OFF 
disable it")
+       endif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+else(ENABLE_CODE_COVERAGE)
+       set(CODE_COVERAGE_DEFINES "")
+       set(CODE_COVERAGE_CFLAGS "")
+       set(CODE_COVERAGE_CXXFLAGS "")
+       set(CODE_COVERAGE_LDFLAGS "")
+endif(ENABLE_CODE_COVERAGE)
diff --git a/cmake/modules/DistTargets.cmake b/cmake/modules/DistTargets.cmake
new file mode 100644
index 0000000..2551d3a
--- /dev/null
+++ b/cmake/modules/DistTargets.cmake
@@ -0,0 +1,87 @@
+# DistTarget.cmake
+#
+# Defines custom targets related to distributing source code.
+# It requires to have populated 'PROJECT_NAME' and 'PROJECT_VERSION' variables,
+# possibly through the project() command. It also uses 'PROJECT_DISTCONFIGURE_PARAMS'
+# variable when configuring the unpacked distribution.
+#
+# Added targets:
+# dist - only creates a tarball
+# disttest - creates a tarball and 'make && make install' it to a temporary prefix
+#    to verify that the code can be built and installed; it also verifies
+#    that the first line of the NEWS file contains the same version as
+#    the tarball and that it claims today's date.
+# distcheck - similar to 'disttest', only runs also 'make check' before installing
+
+# Filenames for tarball
+set(ARCHIVE_BASE_NAME ${PROJECT_NAME}-${PROJECT_VERSION})
+set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
+
+add_custom_target(dist
+       COMMAND ${CMAKE_COMMAND} -E echo "Creating '${ARCHIVE_FULL_NAME}'..."
+       COMMAND git archive --prefix=${ARCHIVE_BASE_NAME}/ HEAD | xz -z > 
${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME}
+       COMMAND ${CMAKE_COMMAND} -E echo "Distribution tarball '${ARCHIVE_FULL_NAME}' created at 
${CMAKE_BINARY_DIR}"
+       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+)
+
+set(disttest_extract_dir "${CMAKE_BINARY_DIR}/${ARCHIVE_BASE_NAME}")
+set(disttest_build_dir "${disttest_extract_dir}/_build")
+set(disttest_install_dir "${disttest_extract_dir}/_install")
+
+add_custom_command(OUTPUT ${disttest_build_dir}/Makefile
+       # remove any left-over directory
+       COMMAND ${CMAKE_COMMAND} -E remove_directory ${disttest_extract_dir}
+
+       # extract the tarball
+       COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} tar -xf ${ARCHIVE_FULL_NAME}
+
+       # verify the NEWS file contains what it should contain
+       COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}
+               bash ${CMAKE_SOURCE_DIR}/cmake/verify-news-file.sh "${disttest_extract_dir}/NEWS" 
"${PROJECT_VERSION}"
+
+       # create a _build sub-directory
+       COMMAND ${CMAKE_COMMAND} -E make_directory "${disttest_build_dir}"
+
+       # configure the project with PROJECT_DISTCHECK_PARAMS
+       COMMAND ${CMAKE_COMMAND} -E chdir "${disttest_build_dir}"
+               ${CMAKE_COMMAND} -G "Unix Makefiles"
+                       ${PROJECT_DISTCONFIGURE_PARAMS}
+                       -DCMAKE_BUILD_TYPE=Release
+                       -DCMAKE_INSTALL_PREFIX="${disttest_install_dir}"
+                       ..
+
+       # 'make' the project
+       COMMAND ${CMAKE_COMMAND} -E chdir ${disttest_build_dir} make -j
+
+       DEPENDS dist
+       COMMENT "Building from distribution tarball ${ARCHIVE_FULL_NAME}..."
+)
+
+add_custom_target(distcheck
+       # 'make check' the project
+       COMMAND ${CMAKE_COMMAND} -E chdir ${disttest_build_dir} make -j check
+
+       # 'make install' the project
+       COMMAND ${CMAKE_COMMAND} -E chdir ${disttest_build_dir} make -j install
+
+       # if we get this far, then everything worked, thus clean up
+       COMMAND ${CMAKE_COMMAND} -E remove_directory ${disttest_extract_dir}
+
+       # and show the good news
+       COMMAND ${CMAKE_COMMAND} -E echo "distcheck of '${ARCHIVE_FULL_NAME}' succeeded"
+
+       DEPENDS ${disttest_build_dir}/Makefile
+)
+
+add_custom_target(disttest
+       # 'make install' the project
+       COMMAND ${CMAKE_COMMAND} -E chdir ${disttest_build_dir} make -j install
+
+       # if we get this far, then everything worked, thus clean up
+       COMMAND ${CMAKE_COMMAND} -E remove_directory ${disttest_extract_dir}
+
+       # and show the good news
+       COMMAND ${CMAKE_COMMAND} -E echo "disttest of '${ARCHIVE_FULL_NAME}' succeeded"
+
+       DEPENDS ${disttest_build_dir}/Makefile
+)
diff --git a/cmake/modules/EvolutionMacros.cmake b/cmake/modules/EvolutionMacros.cmake
new file mode 100644
index 0000000..0491e13
--- /dev/null
+++ b/cmake/modules/EvolutionMacros.cmake
@@ -0,0 +1,63 @@
+# EvolutionMacros.cmake
+#
+# Utility macros for evolution-related files
+#
+# add_error_files(_part _file0)
+#    Adds build and install rules to create .error files from .error.xml
+#    files in the current source directory. The _file0 is expected to be
+#    without the .xml extension. The macro can receive one or more error
+#    files. There is created a custom "${_part}-error-files" target.
+#
+# add_eplug_file(_part _eplug_filename)
+#    Adds build and install rules to create .eplug files from .eplug.xml
+#    files in the current source directory. The _eplug_filename is expected
+#    to be without the .xml extension. The macro can receive exactly one
+#    eplug file. There is created a custom "${_part}-eplug-file" target.
+
+include(FindIntltool)
+
+macro(add_custom_xml_files _part _destination _targetsuffix _ext _mergeparam _file0)
+       set(filedeps)
+
+       foreach(file ${_file0} ${ARGN})
+               intltool_merge(${file}${_ext} ${file} --xml-style --utf8 ${_mergeparam})
+
+               get_filename_component(_path ${file} DIRECTORY)
+               if(_path STREQUAL "")
+                       set(builtfile ${CMAKE_CURRENT_BINARY_DIR}/${file})
+               else(_path STREQUAL "")
+                       set(builtfile ${file})
+               endif(_path STREQUAL "")
+
+               install(FILES ${builtfile}
+                       DESTINATION ${_destination}
+               )
+
+               list(APPEND filedeps ${builtfile})
+       endforeach(file)
+
+       add_custom_target(${_part}-${_targetsuffix}-files ALL
+               DEPENDS ${filedeps}
+       )
+endmacro(add_custom_xml_files)
+
+macro(add_error_files _part _file0)
+       add_custom_xml_files(${_part} ${errordir} error .xml --no-translations ${_file0} ${ARGN})
+endmacro(add_error_files)
+
+macro(add_eplug_file _part _eplug_filename)
+       set(PLUGINDIR "${plugindir}")
+       set(SOEXT "${CMAKE_SHARED_MODULE_SUFFIX}")
+       set(LOCALEDIR "${LOCALE_INSTALL_DIR}")
+
+       configure_file(${_eplug_filename}.xml
+               ${CMAKE_CURRENT_BINARY_DIR}/${_eplug_filename}.in
+               @ONLY
+       )
+
+       unset(PLUGINDIR)
+       unset(SOEXT)
+       unset(LOCALEDIR)
+
+       add_custom_xml_files(${_part} ${plugindir} plugin .in --no-translations 
${CMAKE_CURRENT_BINARY_DIR}/${_eplug_filename})
+endmacro(add_eplug_file)
diff --git a/cmake/modules/FindIntltool.cmake b/cmake/modules/FindIntltool.cmake
new file mode 100644
index 0000000..f6f27fe
--- /dev/null
+++ b/cmake/modules/FindIntltool.cmake
@@ -0,0 +1,209 @@
+# FindIntltool.cmake
+#
+# Searches for intltool and gettext. It aborts, if anything cannot be found.
+# Requires GETTEXT_PO_DIR to be set to full path of the po/ directory.
+#
+# Output is:
+#   INTLTOOL_UPDATE  - an intltool-update executable path, as found
+#   INTLTOOL_EXTRACT  - an intltool-extract executable path, as found
+#   INTLTOOL_MERGE  - an intltool-merge executable path, as found
+#
+# and anything from the FindGettext module.
+#
+# The below provided macros require GETTEXT_PACKAGE to be set.
+#
+# intltool_add_check_potfiles_target()
+#    Adds a check-potfiles target, which verifies that all files with translations
+#    are added in the POTFILES.in file inside GETTEXT_PO_DIR. This macro can be called
+#    only inside GETTEXT_PO_DIR.
+#
+# intltool_add_pot_file_target()
+#    Creates a new target pot-file, which generates ${GETTEXT_PACKAGE}.pot file into
+#    the CMAKE_CURERNT_BINARY_DIR. This target is not part of ALL.
+#    This can be called only inside GETTEXT_PO_DIR.
+#
+# intltool_process_po_files()
+#    Processes all files in the GETTEXT_PO_DIR and generates .gmo files for them
+#    in CMAKE_CURRENT_BINARY_DIR. These are added into a new target gmo-files.
+#    It also installs them into proper location under LOCALE_INSTALL_DIR.
+#    This can be called only inside GETTEXT_PO_DIR.
+#
+# intltool_setup_po_dir()
+#    Shortcut to setup intltool's po/ directory by adding all custom targets
+#    and such. this can be called only inside GETTEXT_PO_DIR.
+#
+# intltool_merge(_in_filename _out_filename ...args)
+#    Adds rule to call intltool-merge. The args are optional arguments.
+#    This can be called in any folder, only the GETTEXT_PO_DIR should
+#    be properly set, otherwise the call will fail.
+#
+# add_appdata_file(_infilename _outfilename)
+#    A shortcut to call intltool-merge() for an appdata file and install it
+#    to ${SHARE_INSTALL_DIR}/appdata
+
+include(FindGettext)
+
+if(NOT GETTEXT_FOUND)
+       message(FATAL_ERROR "gettext not found, please install at least 0.18.3 version")
+endif(NOT GETTEXT_FOUND)
+
+if(NOT GETTEXT_FOUND)
+       message(FATAL_ERROR "gettext not found, please install at least 0.18.3 version")
+endif(NOT GETTEXT_FOUND)
+
+if(GETTEXT_VERSION_STRING VERSION_LESS "0.18.3")
+       message(FATAL_ERROR "gettext version 0.18.3+ required, but version '${GETTEXT_VERSION_STRING}' found 
instead. Please update your gettext")
+endif(GETTEXT_VERSION_STRING VERSION_LESS "0.18.3")
+
+find_program(XGETTEXT xgettext)
+if(NOT XGETTEXT)
+       message(FATAL_ERROR "xgettext executable not found. Please install or update your gettext to at least 
0.18.3 version")
+endif(NOT XGETTEXT)
+
+find_program(INTLTOOL_UPDATE intltool-update)
+if(NOT INTLTOOL_UPDATE)
+       message(FATAL_ERROR "intltool-update not found. Please install it (usually part of an 'intltool' 
package)")
+endif(NOT INTLTOOL_UPDATE)
+
+find_program(INTLTOOL_EXTRACT intltool-extract)
+if(NOT INTLTOOL_EXTRACT)
+       message(FATAL_ERROR "intltool-extract not found. Please install it (usually part of an 'intltool' 
package)")
+endif(NOT INTLTOOL_EXTRACT)
+
+find_program(INTLTOOL_MERGE intltool-merge)
+if(NOT INTLTOOL_MERGE)
+       message(FATAL_ERROR "intltool-merge not found. Please install it (usually part of an 'intltool' 
package)")
+endif(NOT INTLTOOL_MERGE)
+
+macro(intltool_add_check_potfiles_target)
+       if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+               message(FATAL_ERROR "intltool_add_pot_file_target() can be called only inside GETTEXT_PO_DIR 
('${GETTEXT_PO_DIR}'), but it is called inside '${CMAKE_CURRENT_SOURCE_DIR}' instead")
+       endif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+
+       add_custom_target(check-potfiles
+               COMMAND ${INTLTOOL_UPDATE} -m
+               WORKING_DIRECTORY ${GETTEXT_PO_DIR}
+       )
+endmacro(intltool_add_check_potfiles_target)
+
+macro(intltool_add_pot_file_target)
+       if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+               message(FATAL_ERROR "intltool_add_pot_file_target() can be called only inside GETTEXT_PO_DIR 
('${GETTEXT_PO_DIR}'), but it is called inside '${CMAKE_CURRENT_SOURCE_DIR}' instead")
+       endif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+
+       add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${GETTEXT_PACKAGE}.pot
+               COMMAND ${CMAKE_COMMAND} -E env INTLTOOL_EXTRACT="${INTLTOOL_EXTRACT}" XGETTEXT="${XGETTEXT}" 
srcdir=${CMAKE_CURRENT_SOURCE_DIR} ${INTLTOOL_UPDATE} --gettext-package ${GETTEXT_PACKAGE} --pot
+       )
+
+       add_custom_target(pot-file
+               DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${GETTEXT_PACKAGE}.pot
+       )
+endmacro(intltool_add_pot_file_target)
+
+macro(intltool_process_po_files)
+       if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+               message(FATAL_ERROR "intltool_process_po_files() can be called only inside GETTEXT_PO_DIR 
('${GETTEXT_PO_DIR}'), but it is called inside '${CMAKE_CURRENT_SOURCE_DIR}' instead")
+       endif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+
+       file(GLOB po_files ${GETTEXT_PO_DIR}/*.po)
+
+       set(LINGUAS)
+       set(LINGUAS_GMO)
+
+       foreach(file IN LISTS po_files)
+               get_filename_component(lang ${file} NAME_WE)
+               list(APPEND LINGUAS ${lang})
+               list(APPEND LINGUAS_GMO ${lang}.gmo)
+
+               add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo
+                       COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo 
${CMAKE_CURRENT_SOURCE_DIR}/${lang}.po
+                       DEPENDS ${lang}.po
+               )
+
+               install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo
+                       DESTINATION ${LOCALE_INSTALL_DIR}/${lang}/LC_MESSAGES/
+                       RENAME ${GETTEXT_PACKAGE}.mo
+               )
+               if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo.m)
+                       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo.m
+                               DESTINATION ${LOCALE_INSTALL_DIR}/${lang}/LC_MESSAGES/
+                               RENAME ${GETTEXT_PACKAGE}.mo.m
+                       )
+               endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${lang}.gmo.m)
+       endforeach(file)
+
+       add_custom_target(gmo-files ALL
+               DEPENDS ${LINGUAS_GMO}
+       )
+endmacro(intltool_process_po_files)
+
+macro(intltool_setup_po_dir)
+       if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+               message(FATAL_ERROR "intltool_setup_po_dir() can be called only inside GETTEXT_PO_DIR 
('${GETTEXT_PO_DIR}'), but it is called inside '${CMAKE_CURRENT_SOURCE_DIR}' instead")
+       endif(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL GETTEXT_PO_DIR)
+
+       intltool_add_check_potfiles_target()
+       intltool_add_pot_file_target()
+       intltool_process_po_files()
+endmacro(intltool_setup_po_dir)
+
+macro(intltool_merge _in_filename _out_filename)
+       set(_in ${_in_filename})
+       set(_out ${_out_filename})
+
+       get_filename_component(_path ${_in} DIRECTORY)
+       if(_path STREQUAL "")
+               set(_in ${CMAKE_CURRENT_SOURCE_DIR}/${_in})
+       endif(_path STREQUAL "")
+
+       get_filename_component(_path ${_out} DIRECTORY)
+       if(_path STREQUAL "")
+               set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_out})
+       endif(_path STREQUAL "")
+
+       set(_has_no_translations OFF)
+       set(_args)
+       foreach(_arg ${ARGN})
+               list(APPEND _args "${_arg}")
+               if(_arg STREQUAL "--no-translations")
+                       set(_has_no_translations ON)
+               endif(_arg STREQUAL "--no-translations")
+       endforeach(_arg)
+
+       if(_has_no_translations)
+               add_custom_command(OUTPUT ${_out}
+                       COMMAND ${INTLTOOL_MERGE} ${_args} --quiet "${_in}" "${_out}"
+                       DEPENDS ${_in}
+               )
+       else(_has_no_translations)
+               add_custom_command(OUTPUT ${_out}
+                       COMMAND ${INTLTOOL_MERGE} ${_args} --quiet 
--cache="${CMAKE_BINARY_DIR}/po/.intltool-merge-cache" "${GETTEXT_PO_DIR}" "${_in}" "${_out}"
+                       DEPENDS ${_in}
+               )
+       endif(_has_no_translations)
+endmacro(intltool_merge)
+
+macro(add_appdata_file _infilename _outfilename)
+       if(NOT TARGET appdata-files)
+               add_custom_target(appdata-files ALL)
+       endif(NOT TARGET appdata-files)
+
+       set(_out ${_outfilename})
+       get_filename_component(_outtarget ${_out} NAME_WE)
+       get_filename_component(_path ${_out} DIRECTORY)
+       if(_path STREQUAL "")
+               set(_out ${CMAKE_CURRENT_BINARY_DIR}/${_out})
+       endif(_path STREQUAL "")
+
+       intltool_merge(${_infilename} ${_out} --xml-style --utf8)
+
+       add_custom_target(appdata-${_outtarget}
+               DEPENDS ${_out}
+       )
+
+       add_dependencies(appdata-files appdata-${_outtarget})
+
+       install(FILES ${_out}
+               DESTINATION ${SHARE_INSTALL_DIR}/appdata
+       )
+endmacro(add_appdata_file)
diff --git a/cmake/modules/FindLDAP.cmake b/cmake/modules/FindLDAP.cmake
new file mode 100644
index 0000000..bc3bf86
--- /dev/null
+++ b/cmake/modules/FindLDAP.cmake
@@ -0,0 +1,133 @@
+# FindLDAP.cmake
+#
+# Searches for OpenLDAP/SunLDAP library
+#
+# Adds these options:
+#    -DWITH_OPENLDAP=ON/OFF/PATH - enable/disable OpenLDAP, eventually set prefix to find it
+#    -DWITH_SUNLDAP=OFF/ON/PATH - enable/disable SunLDAP, eventually set prefix to find it
+#    -DWITH_STATIC_LDAP=OFF/ON - enable/disable static LDAP linking
+#
+# The OpenLDAP has precedence over SunLDAP, if both are specified. The default is to use OpenLDAP.
+#
+# The output is:
+#    HAVE_LDAP - set to ON, if LDAP support is enabled and libraries found
+#    SUNLDAP - set to ON, when using SunLDAP implementation
+#    LDAP_CFLAGS - CFLAGS to use with target_compile_options() and similar commands
+#    LDAP_INCLUDE_DIRS - include directories to use with target_include_directories() and similar commands
+#    LDAP_LIBS - libraries to use with target_link_libraries() and similar commands
+
+include(CheckCSourceCompiles)
+include(CheckLibraryExists)
+include(PrintableOptions)
+
+add_printable_variable_path(WITH_OPENLDAP "Enable LDAP support using OpenLDAP, default ON" "ON")
+add_printable_variable_path(WITH_SUNLDAP "Enable LDAP support using SunLDAP, default OFF" "OFF")
+add_printable_option(WITH_STATIC_LDAP "Link LDAP statically, default OFF" OFF)
+
+if((NOT WITH_OPENLDAP) AND (NOT WITH_SUNLDAP))
+       return()
+endif((NOT WITH_OPENLDAP) AND (NOT WITH_SUNLDAP))
+
+string(LENGTH "${CMAKE_BINARY_DIR}" bindirlen)
+string(SUBSTRING "${WITH_OPENLDAP}" 0 ${bindirlen} substr)
+string(TOUPPER "${WITH_OPENLDAP}" optupper)
+
+if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+       set(WITH_OPENLDAP "/usr")
+endif(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+
+string(SUBSTRING "${WITH_SUNLDAP}" 0 ${bindirlen} substr)
+string(TOUPPER "${WITH_SUNLDAP}" optupper)
+
+if(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+       set(WITH_SUNLDAP "/usr")
+endif(("${optupper}" STREQUAL "ON") OR ("${substr}" STREQUAL "${CMAKE_BINARY_DIR}"))
+
+unset(bindirlen)
+unset(substr)
+unset(optupper)
+
+set(HAVE_LDAP ON)
+set(SUNLDAP OFF)
+
+macro(add_ldap_lib_if_provides _lib _symbol)
+       CHECK_LIBRARY_EXISTS(${_lib} ${_symbol} "" lib${_lib}_provides_${_symbol})
+       if(lib${_lib}_provides_${_symbol})
+               set(LDAP_LIBS "${LDAP_LIBS} -l${_lib}")
+       endif(lib${_lib}_provides_${_symbol})
+endmacro(add_ldap_lib_if_provides)
+
+set(LDAP_PREFIX "")
+if(WITH_OPENLDAP)
+       set(LDAP_PREFIX "${WITH_OPENLDAP}")
+else(WITH_OPENLDAP)
+       set(LDAP_PREFIX "${WITH_SUNLDAP}")
+       set(SUNLDAP ON)
+endif(WITH_OPENLDAP)
+
+set(LDAP_CFLAGS "")
+set(LDAP_INCLUDE_DIRS "${LDAP_PREFIX}/include")
+set(LDAP_LIBS "-L${LDAP_PREFIX}/lib${LIB_SUFFIX}")
+
+set(CMAKE_REQUIRED_INCLUDES "${LDAP_INCLUDE_DIRS}")
+set(CMAKE_REQUIRED_LIBRARIES "${LDAP_LIBS}")
+
+if(WITH_OPENLDAP)
+       CHECK_C_SOURCE_COMPILES("#include \"ldap.h\"
+                               int main(void) {
+                                       #if !defined(LDAP_VENDOR_VERSION) || LDAP_VENDOR_VERSION < 20000
+                                       #error OpenLDAP version not at least 2.0
+                                       #endif
+                                       return 0; }" openldap_2_x)
+       if(NOT openldap_2_x)
+               message(FATAL_ERROR "At least 2.0 OpenLDAP version required")
+       endif(NOT openldap_2_x)
+else(WITH_OPENLDAP)
+       CHECK_C_SOURCE_COMPILES("#include \"ldap.h\"
+                               int main(void) {
+                                       #if !defined(LDAP_VENDOR_VERSION) || LDAP_VENDOR_VERSION < 500
+                                       #error SunLDAP version not at least 2.0
+                                       #endif
+                                       return 0; }" sunldap_2_x)
+       if(NOT sunldap_2_x)
+               message(FATAL_ERROR "At least 2.0 SunLDAP version required")
+       endif(NOT sunldap_2_x)
+endif(WITH_OPENLDAP)
+
+add_ldap_lib_if_provides(resolv res_query)
+add_ldap_lib_if_provides(resolv __res_query)
+add_ldap_lib_if_provides(socket bind)
+CHECK_LIBRARY_EXISTS(lber ber_get_tag "" liblber_provides_ber_get_tag)
+if(liblber_provides_ber_get_tag)
+       if(WITH_STATIC_LDAP)
+               set(LDAP_LIBS "${LDAP_LIBS} ${LDAP_PREFIX}/lib${LIB_SUFFIX}/liblber.a")
+#              # libldap might depend on OpenSSL... We need to pull
+#              # in the dependency libs explicitly here since we're
+#              # not using libtool for the configure test.
+#              if test -f ${LDAP_PREFIX}/lib${LIB_SUFFIX}/libldap.la; then
+#                      LDAP_LIBS="`. ${LDAP_PREFIX}/libPLIB_SUFFIX}/libldap.la; echo $dependency_libs` 
$LDAP_LIBS"
+#              fi
+       else(WITH_STATIC_LDAP)
+               set(LDAP_LIBS "${LDAP_LIBS} -llber")
+       endif(WITH_STATIC_LDAP)
+endif(liblber_provides_ber_get_tag)
+
+CHECK_LIBRARY_EXISTS(ldap ldap_open "" libldap_provides_ldap_open)
+if(libldap_provides_ldap_open)
+       if(WITH_STATIC_LDAP)
+               set(LDAP_LIBS "${LDAP_LIBS} ${LDAP_PREFIX}/lib${LIB_SUFFIX}/libldap.a")
+       else(WITH_STATIC_LDAP)
+               set(LDAP_LIBS "${LDAP_LIBS} -lldap")
+       endif(WITH_STATIC_LDAP)
+else(libldap_provides_ldap_open)
+       if(WITH_OPENLDAP)
+               message(FATAL_ERROR "Could not find OpenLDAP libraries")
+       else(WITH_OPENLDAP)
+               message(FATAL_ERROR "Could not find SunLDAP libraries")
+       endif(WITH_OPENLDAP)
+endif(libldap_provides_ldap_open)
+
+unset(CMAKE_REQUIRED_INCLUDES)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+add_definitions(-DLDAP_DEPRECATED)
diff --git a/cmake/modules/FindSMIME.cmake b/cmake/modules/FindSMIME.cmake
new file mode 100644
index 0000000..3f47a65
--- /dev/null
+++ b/cmake/modules/FindSMIME.cmake
@@ -0,0 +1,146 @@
+# FindSMIME.cmake
+#
+# Searches for Mozilla's NSS and NSPR libraries, unless -DENABLE_SMIME=OFF is used
+#
+# The output is:
+#    mozilla_nspr - if non-empty, then a pkg-config package name for nspr
+#    mozilla_nss - if non-empty, then a pkg-config package name for nss
+#    MANUAL_NSPR_INCLUDES - if non-empty, then contains manual nspr include directory, used for 
target_include_directories() and similar commands
+#    MANUAL_NSPR_LIBS - if non-empty, then contains manual nspr libraries, used for target_link_libraries() 
and similar commands
+#    MANUAL_NSS_INCLUDES - if non-empty, then contains manual nss include directory, used for 
target_include_directories() and similar commands
+#    MANUAL_NSS_LIBS - if non-empty, then contains manual nss libraries, used for target_link_libraries() 
and similar commands
+#    MOZILLA_NSS_LIB_DIR - a lib directory where Mozilla stores its libraries
+
+include(CheckIncludeFiles)
+include(CheckCSourceCompiles)
+include(PrintableOptions)
+include(PkgConfigEx)
+
+add_printable_option(ENABLE_SMIME "Enable SMIME support through Mozilla nss" ON)
+add_printable_variable_path(WITH_NSPR_INCLUDES "Prefix of Mozilla nspr4 includes" "")
+add_printable_variable_path(WITH_NSPR_LIBS "Prefix of Mozilla nspr4 libs" "")
+add_printable_variable_path(WITH_NSS_INCLUDES "Prefix of Mozilla nss3 includes" "")
+add_printable_variable_path(WITH_NSS_LIBS "Prefix of Mozilla nss3 libs" "")
+
+if(NOT ENABLE_SMIME)
+       return()
+endif(NOT ENABLE_SMIME)
+
+set(mozilla_nspr "")
+set(mozilla_nss "")
+set(MOZILLA_NSS_LIB_DIR "")
+
+# Use pkg-config when none is specified
+if((WITH_NSPR_INCLUDES STREQUAL "") AND (WITH_NSPR_LIBS STREQUAL "") AND (WITH_NSS_INCLUDES STREQUAL "") AND 
(WITH_NSS_INCLUDES STREQUAL ""))
+       foreach(pkg nspr mozilla-nspr firefox-nspr xulrunner-nspr seamonkey-nspr)
+               pkg_check_exists(_have_pkg ${pkg})
+               if(_have_pkg)
+                       set(mozilla_nspr ${pkg})
+                       break()
+               endif(_have_pkg)
+       endforeach(pkg)
+
+       foreach(pkg nss mozilla-nss firefox-nss xulrunner-nss seamonkey-nss)
+               pkg_check_exists(_have_pkg ${pkg})
+               if(_have_pkg)
+                       set(mozilla_nss ${pkg})
+                       break()
+               endif(_have_pkg)
+       endforeach(pkg)
+
+       if((NOT (mozilla_nspr STREQUAL "")) AND (NOT (mozilla_nss STREQUAL "")))
+               pkg_check_variable(_nss_libdir ${mozilla_nss} libdir)
+
+               set(MANUAL_NSPR_INCLUDES "")
+               set(MANUAL_NSPR_LIBS "")
+               set(MANUAL_NSS_INCLUDES "")
+               set(MANUAL_NSS_LIBS "")
+               set(MOZILLA_NSS_LIB_DIR "${_nss_libdir}")
+               return()
+       endif((NOT (mozilla_nspr STREQUAL "")) AND (NOT (mozilla_nss STREQUAL "")))
+endif()
+
+# Manual search, even when pkg-config failed
+
+# ******************
+# Check for NSPR 4
+# ******************
+
+if(NOT (WITH_NSPR_INCLUDES STREQUAL ""))
+       set(CMAKE_REQUIRED_INCLUDES ${WITH_NSPR_INCLUDES})
+endif(NOT (WITH_NSPR_INCLUDES STREQUAL ""))
+
+CHECK_INCLUDE_FILES(nspr.h prio.h _have_headers)
+
+unset(CMAKE_REQUIRED_INCLUDES)
+
+if(NOT _have_headers)
+       message(FATAL_ERROR "NSPR headers not found. Use -DWITH_NSPR_INCLUDES=/path/to/nspr to specify the 
include dir of NSPR.")
+endif(NOT _have_headers)
+
+set(MANUAL_NSPR_INCLUDES "${WITH_NSPR_INCLUDES}")
+
+set(nsprlibs "-lplc4 -lplds4 -lnspr4")
+
+set(CMAKE_REQUIRED_INCLUDES ${MANUAL_NSPR_INCLUDES})
+set(CMAKE_REQUIRED_LIBRARIES ${nsprlibs})
+CHECK_C_SOURCE_COMPILES("#include <prinit.h>
+                       int main(void) { PR_Initialized(); return 0; }" _nsprlibs_okay)
+unset(CMAKE_REQUIRED_FLAGS)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+if(NOT _nsprlibs_okay)
+       message(FATAL_ERROR "NSPR libs not found. Use -DWITH_NSPR_LIBS=/path/to/libs to specify the libdir of 
NSPR")
+endif(NOT _nsprlibs_okay)
+
+set(MANUAL_NSPR_LIBS "")
+
+if(NOT (WITH_NSPR_LIBS STREQUAL ""))
+       set(MANUAL_NSPR_LIBS "-L${WITH_NSPR_LIBS}")
+endif(NOT (WITH_NSPR_LIBS STREQUAL ""))
+
+set(MANUAL_NSPR_LIBS "${MANUAL_NSPR_LIBS} ${nsprlibs}")
+
+# *****************
+# Check for NSS 3
+# *****************
+
+if(NOT (WITH_NSS_INCLUDES STREQUAL ""))
+       set(CMAKE_REQUIRED_INCLUDES ${WITH_NSS_INCLUDES})
+endif(NOT (WITH_NSS_INCLUDES STREQUAL ""))
+
+CHECK_INCLUDE_FILES(nss.h ssl.h smime.h _have_headers)
+
+unset(CMAKE_REQUIRED_INCLUDES)
+
+if(NOT _have_headers)
+       message(FATAL_ERROR "NSS headers not found. Use -DWITH_NSS_INCLUDES=/path/to/nss to specify the 
include dir of NSS.")
+endif(NOT _have_headers)
+
+set(MANUAL_NSS_INCLUDES "${WITH_NSS_INCLUDES} ${MANUAL_NSPR_INCLUDES}")
+
+set(nsslibs "-lssl3 -lsmime3 -lnss3")
+
+set(CMAKE_REQUIRED_INCLUDES ${MANUAL_NSS_INCLUDES})
+set(CMAKE_REQUIRED_LIBRARIES ${nsslibs} ${nsprlibs})
+CHECK_C_SOURCE_COMPILES("#include <nss.h>
+                       int main(void) { NSS_Init(\"\"); return 0; }" _nsslibs_okay)
+unset(CMAKE_REQUIRED_FLAGS)
+unset(CMAKE_REQUIRED_LIBRARIES)
+
+if(NOT _nsslibs_okay)
+       message(FATAL_ERROR "NSS libs not found. Use -DWITH_NSS_LIBS=/path/to/libs to specify the libdir of 
NSS")
+endif(NOT _nsslibs_okay)
+
+set(MANUAL_NSS_LIBS "")
+
+if(NOT (WITH_NSS_LIBS STREQUAL ""))
+       set(MANUAL_NSS_LIBS "-L${WITH_NSS_LIBS}")
+       set(MOZILLA_NSS_LIB_DIR "${WITH_NSS_LIBS}")
+endif(NOT (WITH_NSS_LIBS STREQUAL ""))
+
+set(MANUAL_NSS_LIBS "${MANUAL_NSS_LIBS} ${nsslibs} ${MANUAL_NSPR_LIBS}")
+
+if(MOZILLA_NSS_LIB_DIR STREQUAL "")
+       set(MOZILLA_NSS_LIB_DIR "${LIB_INSTALL_DIR}")
+endif(MOZILLA_NSS_LIB_DIR STREQUAL "")
diff --git a/cmake/modules/GLibTools.cmake b/cmake/modules/GLibTools.cmake
new file mode 100644
index 0000000..ba05824
--- /dev/null
+++ b/cmake/modules/GLibTools.cmake
@@ -0,0 +1,277 @@
+# GLibTools.cmake
+#
+# Provides functions to run glib tools.
+#
+# Functions:
+#
+# glib_mkenums(_output_filename_noext _enums_header _define_name)
+#    runs glib-mkenums to generate enumtypes .h and .c files from _enums_header.
+#    It searches for files in the current source directory and exports to the current
+#    binary directory.
+#
+#    An example call is:
+#        glib_mkenums(camel-enumtypes camel-enums.h CAMEL_ENUMTYPES_H)
+#        which uses camel-enums.h as the source of known enums and generates
+#        camel-enumtypes.h which will use the CAMEL_ENUMTYPES_H define
+#        and also generates camel-enumtypes.c with the needed code.
+#
+# glib_genmarshal(_output_filename_noext _prefix _marshallist_filename)
+#    runs glib-genmarshal to process ${_marshallist_filename} to ${_output_filename_noext}.c
+#    and ${_output_filename_noext}.h files in the current binary directory, using
+#    the ${_prefix} as the function prefix.
+#
+# gdbus_codegen(_xml _interface_prefix _c_namespace _files_prefix _list_gens)
+#    runs gdbus-codegen to generate GDBus code from _xml file description,
+#    using _interface_prefix, _c_namespace and _files_prefix as arguments.
+#    The _list_gens is a list variable are stored expected generated files.
+#
+#    An example call is:
+#        set(GENERATED_DBUS_LOCALE
+#               e-dbus-localed.c
+#              e-dbus-localed.h
+#        )
+#        gdbus_codegen(org.freedesktop.locale1.xml org.freedesktop. E_DBus e-dbus-localed 
GENERATED_DBUS_LOCALE)
+#
+# gdbus_codegen_custom(_xml _interface_prefix _c_namespace _files_prefix _list_gens _args)
+#    The same as gdbus_codegen() except allows to pass other arguments to the call,
+#    like for example --c-generate-object-manager
+#
+# add_gsettings_schemas(_target _schema0 ...)
+#    Adds one or more GSettings schemas. The extension is supposed to be .gschema.xml. The schema file 
generation
+#    is added as a dependency of _target.
+#
+# glib_compile_resources _sourcedir _outputprefix _cname _inxml ...deps)
+#    Calls glib-compile-resources as defined in _inxml and using _outputprefix and_cname as other arguments
+#    beside _sourcedir. The optional arguments are other dependencies.
+
+include(PkgConfigEx)
+include(UninstallTarget)
+
+find_program(GLIB_MKENUMS glib-mkenums)
+if(NOT GLIB_MKENUMS)
+       message(FATAL_ERROR "Cannot find glib-mkenums, which is required to build ${PROJECT_NAME}")
+endif(NOT GLIB_MKENUMS)
+
+function(glib_mkenums _output_filename_noext _enums_header _define_name)
+       set(HEADER_TMPL "
+/*** BEGIN file-header ***/
+#ifndef ${_define_name}
+#define ${_define_name}
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/* Enumerations from \"@filename@\" */
+
+/*** END file-production ***/
+
+/*** BEGIN enumeration-production ***/
+#define @ENUMPREFIX@_TYPE_@ENUMSHORT@  (@enum_name@_get_type())
+GType @enum_name@_get_type     (void) G_GNUC_CONST;
+
+/*** END enumeration-production ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* ${_define_name} */
+/*** END file-tail ***/")
+
+       file(WRITE 
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.h.tmpl" 
"${HEADER_TMPL}\n")
+
+       add_custom_command(
+               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
+               COMMAND ${GLIB_MKENUMS} --template 
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.h.tmpl" 
"${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
+       )
+
+set(SOURCE_TMPL "
+/*** BEGIN file-header ***/
+#include \"${_output_filename_noext}.h\"
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from \"@filename@\" */
+#include \"@filename@\"
+
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+       static volatile gsize the_type__volatile = 0;
+
+       if (g_once_init_enter (&the_type__volatile)) {
+               static const G\@Type\@Value values[] = {
+/*** END value-header ***/
+
+/*** BEGIN value-production ***/
+                       { \@VALUENAME\@,
+                         \"@VALUENAME@\",
+                         \"@valuenick@\" },
+/*** END value-production ***/
+
+/*** BEGIN value-tail ***/
+                       { 0, NULL, NULL }
+               };
+               GType the_type = g_\@type\@_register_static (
+                       g_intern_static_string (\"@EnumName@\"),
+                       values);
+               g_once_init_leave (&the_type__volatile, the_type);
+       }
+       return the_type__volatile;
+}
+
+/*** END value-tail ***/")
+
+       file(WRITE 
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.c.tmpl" 
"${SOURCE_TMPL}\n")
+
+       add_custom_command(
+               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
+               COMMAND ${GLIB_MKENUMS} --template 
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/enumtypes-${_output_filename_noext}.c.tmpl" 
"${CMAKE_CURRENT_SOURCE_DIR}/${_enums_header}" >${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
+       )
+endfunction(glib_mkenums)
+
+find_program(GLIB_GENMARSHAL glib-genmarshal)
+if(NOT GLIB_GENMARSHAL)
+       message(FATAL_ERROR "Cannot find glib-genmarshal, which is required to build ${PROJECT_NAME}")
+endif(NOT GLIB_GENMARSHAL)
+
+function(glib_genmarshal _output_filename_noext _prefix _marshallist_filename)
+       add_custom_command(
+               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
+               COMMAND ${GLIB_GENMARSHAL} --header --prefix=${_prefix} 
"${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp
+               COMMAND ${CMAKE_COMMAND} -E rename 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h.tmp 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.h
+               DEPENDS ${_marshallist_filename}
+       )
+
+       add_custom_command(
+               OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
+               COMMAND ${CMAKE_COMMAND} -E echo " #include \\\"${_output_filename_noext}.h\\\"" 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp
+               COMMAND ${GLIB_GENMARSHAL} --body --prefix=${_prefix} 
"${CMAKE_CURRENT_SOURCE_DIR}/${_marshallist_filename}" 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp
+               COMMAND ${CMAKE_COMMAND} -E rename 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c.tmp 
${CMAKE_CURRENT_BINARY_DIR}/${_output_filename_noext}.c
+               DEPENDS ${_marshallist_filename}
+       )
+endfunction(glib_genmarshal)
+
+find_program(GDBUS_CODEGEN gdbus-codegen)
+if(NOT GDBUS_CODEGEN)
+       message(FATAL_ERROR "Cannot find gdbus-codegen, which is required to build ${PROJECT_NAME}")
+endif(NOT GDBUS_CODEGEN)
+
+function(gdbus_codegen_custom _xml _interface_prefix _c_namespace _files_prefix _list_gens _args)
+       add_custom_command(
+               OUTPUT ${${_list_gens}}
+               COMMAND ${GDBUS_CODEGEN}
+               ARGS --interface-prefix ${_interface_prefix}
+                       --c-namespace ${_c_namespace}
+                       --generate-c-code ${_files_prefix}
+                       --generate-docbook ${_files_prefix}
+                       ${_args}
+                       ${CMAKE_CURRENT_SOURCE_DIR}/${_xml}
+               VERBATIM
+       )
+endfunction(gdbus_codegen_custom)
+
+function(gdbus_codegen _xml _interface_prefix _c_namespace _files_prefix _list_gens)
+       gdbus_codegen_custom(${_xml} ${_interface_prefix} ${_c_namespace} ${_files_prefix} ${_list_gens} "")
+endfunction(gdbus_codegen)
+
+add_printable_option(ENABLE_SCHEMAS_COMPILE "Enable GSettings regeneration of gschemas.compile on install" 
ON)
+
+if(CMAKE_CROSSCOMPILING)
+       find_program(GLIB_COMPILE_SCHEMAS glib-compile-schemas)
+else(CMAKE_CROSSCOMPILING)
+       pkg_check_variable(GLIB_COMPILE_SCHEMAS gio-2.0 glib_compile_schemas)
+endif(CMAKE_CROSSCOMPILING)
+
+if(NOT GLIB_COMPILE_SCHEMAS)
+       message(FATAL_ERROR "Cannot find glib-compile-schemas, which is required to build ${PROJECT_NAME}")
+endif(NOT GLIB_COMPILE_SCHEMAS)
+
+set(GSETTINGS_SCHEMAS_DIR "${SHARE_INSTALL_DIR}/glib-2.0/schemas/")
+
+macro(add_gsettings_schemas _target _schema0)
+       set(_install_code)
+
+       foreach(_schema ${_schema0} ${ARGN})
+               string(REPLACE ".xml" ".valid" _outputfile "${_schema}")
+               get_filename_component(_outputfile "${_outputfile}" NAME)
+
+               get_filename_component(_schema_fullname "${_schema}" DIRECTORY)
+               get_filename_component(_schema_filename "${_schema}" NAME)
+               if(_schema_fullname STREQUAL "")
+                       set(_schema_fullname ${CMAKE_CURRENT_SOURCE_DIR}/${_schema})
+               else(_schema_fullname STREQUAL "")
+                       set(_schema_fullname ${_schema})
+               endif(_schema_fullname STREQUAL "")
+
+               add_custom_command(
+                       OUTPUT ${_outputfile}
+                       COMMAND ${GLIB_COMPILE_SCHEMAS} --strict --dry-run --schema-file=${_schema_fullname}
+                       COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_schema_fullname}" 
"${CMAKE_CURRENT_BINARY_DIR}/${_outputfile}"
+                       DEPENDS ${_schema_fullname}
+                       VERBATIM
+               )
+               add_custom_target(gsettings-schemas-${_schema_filename} ALL DEPENDS ${_outputfile})
+               add_dependencies(${_target} gsettings-schemas-${_schema_filename})
+               if(ENABLE_SCHEMAS_COMPILE)
+                       # this is required to compile gsettings schemas like after 'make install,
+                       # because there is no better way in CMake to run a code/script after
+                       # the whole `make install`
+                       set(_install_code "${_install_code}
+                               COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${_schema_fullname}\" 
\"${GSETTINGS_SCHEMAS_DIR}\""
+                       )
+               endif(ENABLE_SCHEMAS_COMPILE)
+
+               # Do both, to have 'uninstall' working properly
+               install(FILES ${_schema_fullname}
+                       DESTINATION ${GSETTINGS_SCHEMAS_DIR})
+       endforeach(_schema)
+
+       if(_install_code)
+               # Compile gsettings schemas and ensure that all of them are in the place.
+               install(CODE
+                       "execute_process(${_install_code}
+                               COMMAND ${CMAKE_COMMAND} -E chdir . \"${GLIB_COMPILE_SCHEMAS}\" 
\"${GSETTINGS_SCHEMAS_DIR}\"
+                       )")
+       endif(_install_code)
+endmacro(add_gsettings_schemas)
+
+# This is called too early, when the schemas are not installed yet during `make install`
+#
+# compile_gsettings_schemas()
+#    Optionally (based on ENABLE_SCHEMAS_COMPILE) recompiles schemas at the destination folder
+#    after install. It's necessary to call it as the last command in the toplevel CMakeLists.txt,
+#    thus the compile runs when all the schemas are installed.
+#
+if(ENABLE_SCHEMAS_COMPILE)
+       add_custom_command(TARGET uninstall POST_BUILD
+               COMMAND ${CMAKE_COMMAND} -E chdir . "${GLIB_COMPILE_SCHEMAS}" "${GSETTINGS_SCHEMAS_DIR}"
+               COMMENT "Recompile GSettings schemas in '${GSETTINGS_SCHEMAS_DIR}'"
+       )
+endif(ENABLE_SCHEMAS_COMPILE)
+
+find_program(GLIB_COMPILE_RESOURCES glib-compile-resources)
+if(NOT GLIB_COMPILE_RESOURCES)
+       message(FATAL_ERROR "Cannot find glib-compile-resources, which is required to build ${PROJECT_NAME}")
+endif(NOT GLIB_COMPILE_RESOURCES)
+
+macro(glib_compile_resources _sourcedir _outputprefix _cname _inxml)
+       add_custom_command(
+               OUTPUT ${_outputprefix}.h
+               COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml} 
--target=${_outputprefix}.h --sourcedir=${_sourcedir} --c-name ${_cname} --generate-header
+               DEPENDS ${_inxml} ${ARGN}
+               VERBATIM
+       )
+       add_custom_command(
+               OUTPUT ${_outputprefix}.c
+               COMMAND ${GLIB_COMPILE_RESOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/${_inxml} 
--target=${_outputprefix}.c --sourcedir=${_sourcedir} --c-name ${_cname} --generate-source
+               DEPENDS ${_inxml} ${ARGN}
+               VERBATIM
+       )
+endmacro(glib_compile_resources)
diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake
new file mode 100644
index 0000000..4aa286a
--- /dev/null
+++ b/cmake/modules/GtkDoc.cmake
@@ -0,0 +1,150 @@
+# GtkDoc.cmake
+#
+# Macros to support develper documentation build from sources with gtk-doc.
+#
+# add_gtkdoc(_module _namespace _deprecated_guards _srcdirsvar _depsvar _ignoreheadersvar)
+#    Adds rules to build developer documentation using gtk-doc for some part.
+#    Arguments:
+#       _module - the module name, like 'camel'; it expects ${_part}-docs.sgml.in in the 
CMAKE_CURRENT_SOURCE_DIR
+#       _namespace - namespace for symbols
+#       _deprecated_guards - define name, which guards deprecated symbols
+#       _srcdirsvar - variable with dirs where the source files are located
+#       _depsvar - a variable with dependencies (targets)
+#       _ignoreheadersvar - a variable with a set of header files to ignore
+#
+# It also adds custom target gtkdoc-rebuild-${_module}-sgml to rebuild the sgml.in
+# file based on the current sources.
+
+include(PrintableOptions)
+
+add_printable_option(ENABLE_GTK_DOC "Use gtk-doc to build documentation" OFF)
+
+if(NOT ENABLE_GTK_DOC)
+       return()
+endif(NOT ENABLE_GTK_DOC)
+
+find_program(GTKDOC_SCAN gtkdoc-scan)
+find_program(GTKDOC_MKDB gtkdoc-mkdb)
+find_program(GTKDOC_MKHTML gtkdoc-mkhtml)
+find_program(GTKDOC_FIXXREF gtkdoc-fixxref)
+
+if(NOT (GTKDOC_SCAN AND GTKDOC_MKDB AND GTKDOC_MKHTML AND GTKDOC_FIXXREF))
+       message(FATAL_ERROR "Cannot find all gtk-doc binaries, install them or use -DENABLE_GTK_DOC=OFF 
instead")
+       return()
+endif()
+
+if(NOT TARGET gtkdocs)
+       add_custom_target(gtkdocs ALL)
+endif(NOT TARGET gtkdocs)
+
+if(NOT TARGET gtkdoc-rebuild-sgmls)
+       add_custom_target(gtkdoc-rebuild-sgmls)
+endif(NOT TARGET gtkdoc-rebuild-sgmls)
+
+macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ignoreheadersvar)
+       configure_file(
+               ${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
+               ${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml
+               @ONLY
+       )
+
+       set(OUTPUT_DOCDIR ${SHARE_INSTALL_DIR}/gtk-doc/html/${_module})
+
+       set(_ignore_headers)
+       foreach(_header ${${_ignoreheadersvar}})
+               set(_ignore_headers "${_ignore_headers} ${_header}")
+       endforeach(_header)
+
+       set(_filedeps)
+       set(_srcdirs)
+       foreach(_srcdir ${${_srcdirsvar}})
+               set(_srcdirs ${_srcdirs} --source-dir="${_srcdir}")
+               file(GLOB _files ${_srcdir}/*.h* ${_srcdir}/*.c*)
+               list(APPEND _filedeps ${_files})
+       endforeach(_srcdir)
+
+       set(_mkhtml_prefix "")
+       if(APPLE)
+               set(_mkhtml_prefix "${CMAKE_COMMAND} -E env XML_CATALOG_FILES=\"/usr/local/etc/xml/catalog\"")
+       endif(APPLE)
+
+       add_custom_command(OUTPUT html/index.html
+               COMMAND ${GTKDOC_SCAN}
+                       --module=${_module}
+                       --deprecated-guards="${_deprecated_guards}"
+                       --ignore-headers="${_ignore_headers}"
+                       --rebuild-sections
+                       --rebuild-types
+                       ${_srcdirs}
+
+               COMMAND ${GTKDOC_MKDB}
+                       --module=${_module}
+                       --name-space=${_namespace}
+                       --main-sgml-file="${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml"
+                       --sgml-mode
+                       --output-format=xml
+                       ${_srcdirs}
+
+               COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/html"
+
+               COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/html" ${_mkhtml_prefix} 
${GTKDOC_MKHTML} --path=.. ${_module} ../${_module}-docs.sgml
+
+               COMMAND ${GTKDOC_FIXXREF}
+                       --module=${_module}
+                       --module-dir=.
+                       --extra-dir=..
+                       --html-dir="${OUTPUT_DOCDIR}"
+
+               WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+               DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_module}-docs.sgml"
+                       ${_filedeps}
+               COMMENT "Generating ${_module} documentation"
+       )
+
+       add_custom_target(gtkdoc-${_module}
+               DEPENDS html/index.html
+       )
+
+       if(${_depsvar})
+               add_dependencies(gtkdoc-${_module} ${${_depsvar}})
+       endif(${_depsvar})
+
+       add_dependencies(gtkdocs gtkdoc-${_module})
+
+       install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
+               DESTINATION ${OUTPUT_DOCDIR}
+       )
+
+       # ***************************************
+       # sgml.in file rebuild, unconditional
+       # ***************************************
+       add_custom_target(gtkdoc-rebuild-${_module}-sgml
+               COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/tmp"
+               COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/tmp"
+
+               COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/tmp"
+                       ${GTKDOC_SCAN}
+                       --module=${_module}
+                       --deprecated-guards="${_deprecated_guards}"
+                       --ignore-headers="${_ignore_headers}"
+                       --rebuild-sections
+                       --rebuild-types
+                       ${_srcdirs}
+
+               COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/tmp"
+                       ${GTKDOC_MKDB}
+                       --module=${_module}
+                       --name-space=${_namespace}
+                       --main-sgml-file="${CMAKE_CURRENT_BINARY_DIR}/tmp/${_module}-docs.sgml"
+                       --sgml-mode
+                       --output-format=xml
+                       ${_srcdirs}
+
+               COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/tmp/${_module}-docs.sgml 
${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in
+
+               COMMAND ${CMAKE_COMMAND} -E echo "File '${CMAKE_CURRENT_SOURCE_DIR}/${_module}-docs.sgml.in' 
overwritten, make sure you replace generated strings with proper content before committing."
+       )
+
+       add_dependencies(gtkdoc-rebuild-sgmls gtkdoc-rebuild-${_module}-sgml)
+
+endmacro(add_gtkdoc)
diff --git a/cmake/modules/IconCache.cmake b/cmake/modules/IconCache.cmake
new file mode 100644
index 0000000..065a44b
--- /dev/null
+++ b/cmake/modules/IconCache.cmake
@@ -0,0 +1,74 @@
+# IconCache.cmake
+#
+# This is required here only to have defined target 'uninstall'
+# in the same directory.
+#
+# Macros:
+# add_icon_cache_files(_destdir _fileslistvar ...)
+#    adds rules to install icons to icon cache directory with prefix _destdir;
+#    the other arguments are one or more list variables with file names.
+
+include(UninstallTarget)
+
+macro(get_one_icon_component _instring _outvalue _outrest)
+       string(FIND "${_instring}" "_" _pos)
+       if(_pos EQUAL -1)
+               message(FATAL_ERROR "get_one_icon_component() failed to get one component from 
'${_instring}'")
+       endif(_pos EQUAL -1)
+
+       math(EXPR _posinc "${_pos}+1")
+
+       string(SUBSTRING "${_instring}" 0 ${_pos} ${_outvalue})
+       string(SUBSTRING "${_instring}" ${_posinc} -1 ${_outrest})
+endmacro(get_one_icon_component)
+
+macro(split_icon_components _infilename _outtheme _outcontext _outsize _outiconfile)
+       set(_rest "${_infilename}")
+
+       get_one_icon_component("${_rest}" ${_outtheme} _rest)
+       get_one_icon_component("${_rest}" ${_outcontext} _rest)
+       get_one_icon_component("${_rest}" ${_outsize} _rest)
+       set(${_outiconfile} "${_rest}")
+endmacro(split_icon_components)
+
+find_program(GTK_UPDATE_ICON_CACHE gtk-update-icon-cache)
+if(NOT GTK_UPDATE_ICON_CACHE)
+       message(WARNING "gtk-update-icon-cache not found. Make sure to call ${GTK_UPDATE_ICON_CACHE} -f -t 
\"${SHARE_INSTALL_DIR}/icons/hicolor\" after install and uninstall")
+endif(NOT GTK_UPDATE_ICON_CACHE)
+
+set(_update_icon_cache_cmd ${GTK_UPDATE_ICON_CACHE} -f -t "${SHARE_INSTALL_DIR}/icons/hicolor")
+
+macro(process_icons _destdir _fileslistvar _install_codevar)
+       foreach(srcfile IN LISTS ${_fileslistvar})
+               split_icon_components(${srcfile} theme context size iconfile)
+               install(FILES ${srcfile}
+                       DESTINATION ${_destdir}/icons/${theme}/${size}/${context}
+                       RENAME ${iconfile}
+               )
+               set(${_install_codevar} "${${_install_codevar}}
+                       COMMAND ${CMAKE_COMMAND} -E copy_if_different 
\"${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}\" \"${_destdir}/icons/${theme}/${size}/${context}/${iconfile}\""
+               )
+       endforeach(srcfile)
+endmacro(process_icons)
+
+macro(add_icon_cache_files _destdir _fileslistvar)
+       set(_install_code)
+
+       foreach(_filesvar ${_fileslistvar} ${ARGN})
+               process_icons("${_destdir}" ${_filesvar} _install_code)
+       endforeach(_filesvar)
+
+       if(GTK_UPDATE_ICON_CACHE)
+               install(CODE
+                       "execute_process(${_install_code}
+                               COMMAND ${CMAKE_COMMAND} -E chdir . ${_update_icon_cache_cmd}
+                       )")
+       endif(GTK_UPDATE_ICON_CACHE)
+endmacro(add_icon_cache_files)
+
+if(GTK_UPDATE_ICON_CACHE)
+       add_custom_command(TARGET uninstall POST_BUILD
+               COMMAND ${CMAKE_COMMAND} -E chdir . ${_update_icon_cache_cmd}
+               COMMENT "Updating icon cache in '${SHARE_INSTALL_DIR}/icons/hicolor'"
+       )
+endif(GTK_UPDATE_ICON_CACHE)
diff --git a/cmake/modules/InstalledTests.cmake b/cmake/modules/InstalledTests.cmake
new file mode 100644
index 0000000..ec44553
--- /dev/null
+++ b/cmake/modules/InstalledTests.cmake
@@ -0,0 +1,88 @@
+# InstalledTests.cmake
+#
+# Adds option ENABLE_INSTALLED_TESTS and helper macros to manage
+# installed test. There are also set variables:
+# INSTALLED_TESTS_EXEC_DIR - where to store installed tests and eventually its data
+# INSTALLED_TESTS_META_DIR - where to store .test meta files for installed tests
+#
+# install_test_if_enabled(_test_target _type _environ)
+#    Adds rules to install a test whose target is _test_target (the one
+#    used for add_executable()), while the target name should match
+#    the executable name. The _type and _environ are used for populating
+#    the .test meta file.
+#
+# install_behave_tests_if_enabled(_testsvar _type _environ)
+#    Adds rules to install the 'behave' tests as stored in _testsvar
+#    in the current source directory.
+
+include(PrintableOptions)
+
+add_printable_option(ENABLE_INSTALLED_TESTS "Enable installed tests" OFF)
+
+set(INSTALLED_TESTS_EXEC_DIR ${privlibexecdir}/installed-tests)
+set(INSTALLED_TESTS_META_DIR ${SHARE_INSTALL_DIR}/installed-tests/${PROJECT_NAME})
+
+macro(install_test_if_enabled _test_target _type _environ)
+       if(ENABLE_INSTALLED_TESTS)
+               set(TEST_TYPE ${_type})
+               set(TEST_ENVIRONMENT)
+               if(NOT ${_environ} STREQUAL "")
+                       set(TEST_ENVIRONMENT "env ${_environ} ")
+               endif(NOT ${_environ} STREQUAL "")
+
+               set(teststring "[Test]
+Type=${TEST_TYPE}
+Exec=${TEST_ENVIRONMENT}${INSTALLED_TESTS_EXEC_DIR}/${_test_target}
+"
+)
+
+               file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_test_target}.test "${teststring}")
+
+               install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_test_target}.test
+                       DESTINATION ${INSTALLED_TESTS_META_DIR}
+               )
+
+               install(TARGETS ${_test_target}
+                       DESTINATION ${INSTALLED_TESTS_EXEC_DIR}
+               )
+       endif(ENABLE_INSTALLED_TESTS)
+endmacro(install_test_if_enabled)
+
+macro(install_behave_tests_if_enabled _testsvar _type _environ)
+       if(ENABLE_INSTALLED_TESTS)
+               set(TEST_TYPE ${_type})
+               set(TEST_ENVIRONMENT)
+               if(NOT ${_environ} STREQUAL "")
+                       set(TEST_ENVIRONMENT "env ${_environ} ")
+               endif(NOT ${_environ} STREQUAL "")
+
+               file(GLOB BEHAVE_FEATURES ${CMAKE_CURRENT_SOURCE_DIR}/*.feature)
+               file(GLOB BEHAVE_STEP_DEFINITIONS ${CMAKE_CURRENT_SOURCE_DIR}/steps/*.py)
+               set(BEHAVE_COMMON_FILES
+                       ${CMAKE_CURRENT_SOURCE_DIR}/environment.py
+                       ${CMAKE_CURRENT_SOURCE_DIR}/common_steps.py
+               )
+
+               install(FILES ${BEHAVE_FEATURES} ${BEHAVE_COMMON_FILES}
+                       DESTINATION ${INSTALLED_TESTS_EXEC_DIR}
+               )
+
+               install(FILES ${BEHAVE_STEP_DEFINITIONS}
+                       DESTINATION ${INSTALLED_TESTS_EXEC_DIR}/steps/
+               )
+
+               foreach(_test ${${_testsvar}})
+                       set(teststring "[Test]
+Type=${TEST_TYPE}
+Exec=${TEST_ENVIRONMENT}behave ${INSTALLED_TESTS_EXEC_DIR} -t ${_test} -k -f html -o ${_test}.html -f plain
+"
+)
+
+                       file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_test}.test "${teststring}")
+
+                       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_test}.test
+                               DESTINATION ${INSTALLED_TESTS_META_DIR}
+                       )
+               endforeach(_test)
+       endif(ENABLE_INSTALLED_TESTS)
+endmacro(install_behave_tests_if_enabled)
diff --git a/cmake/modules/PkgConfigEx.cmake b/cmake/modules/PkgConfigEx.cmake
new file mode 100644
index 0000000..866fe7c
--- /dev/null
+++ b/cmake/modules/PkgConfigEx.cmake
@@ -0,0 +1,90 @@
+# PkgConfigEx.cmake
+#
+# Extends CMake's PkgConfig module with commands:
+#
+# pkg_check_modules_for_option(_option_name _option_description _prefix _module0)
+#
+#    which calls `pkg_check_modules(_prefix _module0)` and if <_prefix>_FOUND is False,
+#    then prints an error with a hint to disaable the _option_name if needed.
+#
+# pkg_check_exists(_output_name _pkg)
+#
+#    calls pkg-config --exists for _pkg and stores the result to _output_name.
+#
+# pkg_check_at_least_version(_output_name _pkg _version)
+#
+#    calls pkg-config --at-least-version=_version for _pkg and stores the result to _output_name.
+#
+# pkg_check_exact_version(_output_name _pkg _version)
+#
+#    calls pkg-config --exact-version=_version for _pkg and stores the result to _output_name.
+#
+# pkg_check_variable(_output_name _pkg _name)
+#
+#    gets a variable named _name from package _pkg and stores the result into _output_name
+
+find_package(PkgConfig REQUIRED)
+
+macro(pkg_check_modules_for_option _option_name _option_description _prefix _module0)
+       pkg_check_modules(${_prefix} ${_module0} ${ARGN})
+
+       if(NOT ${_prefix}_FOUND)
+               message(FATAL_ERROR "Necessary libraries not found or not enough version. If you want to 
disable ${_option_description}, please use -D${_option_name}=OFF argument to cmake command.")
+       endif(NOT ${_prefix}_FOUND)
+endmacro()
+
+macro(pkg_check_exists _output_name _pkg)
+       execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --exists ${_pkg}
+                       RESULT_VARIABLE ${_output_name})
+
+       # Negate the result, because 0 means 'found'
+       if(${_output_name})
+               set(${_output_name} OFF)
+       else(${_output_name})
+               set(${_output_name} ON)
+       endif(${_output_name})
+endmacro()
+
+macro(pkg_check_at_least_version _output_name _pkg _version)
+       execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --atleast-version=${_version} ${_pkg}
+                       RESULT_VARIABLE ${_output_name})
+
+       # Negate the result, because 0 means 'found'
+       if(${_output_name})
+               set(${_output_name} OFF)
+       else(${_output_name})
+               set(${_output_name} ON)
+       endif(${_output_name})
+endmacro()
+
+macro(pkg_check_exact_version _output_name _pkg _version)
+       execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --exact-version=${_version} ${_pkg}
+                       RESULT_VARIABLE ${_output_name})
+
+       # Negate the result, because 0 means 'found'
+       if(${_output_name})
+               set(${_output_name} OFF)
+       else(${_output_name})
+               set(${_output_name} ON)
+       endif(${_output_name})
+endmacro()
+
+function(pkg_check_variable _output_name _pkg _name)
+    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_name} ${_pkg}
+                    OUTPUT_VARIABLE _pkg_result
+                    OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    set("${_output_name}" "${_pkg_result}" CACHE STRING "pkg-config variable ${_name} of ${_pkg}")
+endfunction()
+
+macro(add_pkgconfig_file _input _output)
+       configure_file(
+               ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
+               ${CMAKE_CURRENT_BINARY_DIR}/${_output}
+               @ONLY
+       )
+
+       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_output}
+               DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+       )
+endmacro()
diff --git a/cmake/modules/PrintableOptions.cmake b/cmake/modules/PrintableOptions.cmake
new file mode 100644
index 0000000..23ce356
--- /dev/null
+++ b/cmake/modules/PrintableOptions.cmake
@@ -0,0 +1,74 @@
+# PrintableOptions.cmake
+#
+# Provides functions to manage printable otpions,
+# which can be printed at the end of the configuration
+#
+# add_printable_variable_bare(_name)
+#    adds variable named _name to the list of prinable options
+#
+# add_printable_option(_name _description _default_value)
+#    the same as option() commnd, only also notes this option for later printing
+#
+# add_printable_variable(_name _description _default_value)
+#    sets a new cached STRING variable and adds it to the list of printable options
+#
+# add_printable_variable_path(_name _description _default_value)
+#    sets a new cached PATH variable and adds it to the list of printable options
+#
+# print_build_options()
+#    prints all the build options previously added with the above functions
+
+macro(add_printable_variable_bare _name)
+       if(_name STREQUAL "")
+               message(FATAL_ERROR "variable name cannot be empty")
+       endif(_name STREQUAL "")
+       list(APPEND _printable_options ${_name})
+endmacro()
+
+macro(add_printable_option _name _description _default_value)
+       if(_name STREQUAL "")
+               message(FATAL_ERROR "option name cannot be empty")
+       endif(_name STREQUAL "")
+       option(${_name} ${_description} ${_default_value})
+       add_printable_variable_bare(${_name})
+endmacro()
+
+macro(add_printable_variable _name _description _default_value)
+       if(_name STREQUAL "")
+               message(FATAL_ERROR "variable name cannot be empty")
+       endif(_name STREQUAL "")
+       set(${_name} ${_default_value} CACHE STRING ${_description})
+       add_printable_variable_bare(${_name})
+endmacro()
+
+macro(add_printable_variable_path _name _description _default_value)
+       if(_name STREQUAL "")
+               message(FATAL_ERROR "path variable name cannot be empty")
+       endif(_name STREQUAL "")
+       set(${_name} ${_default_value} CACHE PATH ${_description})
+       add_printable_variable_bare(${_name})
+endmacro()
+
+function(print_build_options)
+       message(STATUS "Configure options:")
+
+       set(max_len 0)
+       foreach(opt IN LISTS _printable_options)
+               string(LENGTH "${opt}" len)
+               if(max_len LESS len)
+                       set(max_len ${len})
+               endif(max_len LESS len)
+       endforeach()
+       math(EXPR max_len "${max_len} + 2")
+
+       foreach(opt IN LISTS _printable_options)
+               string(LENGTH "${opt}" len)
+               set(str "   ${opt} ")
+               foreach (IGNORE RANGE ${len} ${max_len})
+                       set(str "${str}.")
+               endforeach ()
+               set(str "${str} ${${opt}}")
+
+               message(STATUS ${str})
+       endforeach()
+endfunction()
diff --git a/cmake/modules/SetupBuildFlags.cmake b/cmake/modules/SetupBuildFlags.cmake
new file mode 100644
index 0000000..a7d2aa4
--- /dev/null
+++ b/cmake/modules/SetupBuildFlags.cmake
@@ -0,0 +1,80 @@
+# SetupBuildFlags.cmake
+#
+# Setups compiler/linker flags, skipping those which are not supported.
+
+include(CheckCCompilerFlag)
+include(CheckCXXCompilerFlag)
+
+macro(setup_build_flags _maintainer_mode)
+       list(APPEND proposed_flags
+               -Werror-implicit-function-declaration
+               -Wformat
+               -Wformat-security
+               -Winit-self
+               -Wmissing-declarations
+               -Wmissing-noreturn
+               -Wpointer-arith
+               -Wredundant-decls
+               -Wundef
+               -Wwrite-strings
+               -no-undefined
+               -fno-strict-aliasing
+       )
+
+       if(_maintainer_mode)
+               list(APPEND proposed_flags
+                       -Wall
+                       -Wextra
+                       -Wdeprecated-declarations
+                       -Wmissing-include-dirs
+               )
+       else(_maintainer_mode)
+               list(APPEND proposed_flags
+                       -Wno-deprecated-declarations
+                       -Wno-missing-include-dir)
+       endif(_maintainer_mode)
+
+       list(APPEND proposed_c_flags
+               ${proposed_flags}
+               -Wdeclaration-after-statement
+               -Wno-missing-field-initializers
+               -Wno-sign-compare
+               -Wno-unused-parameter
+               -Wnested-externs
+       )
+
+       if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+               list(APPEND proposed_c_flags
+                       -Wno-parentheses-equality
+                       -Wno-format-nonliteral
+               )
+       endif("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
+
+       list(APPEND proposed_cxx_flags
+               ${proposed_flags}
+               -Wabi
+               -Wnoexcept
+       )
+
+       foreach(flag IN LISTS proposed_c_flags)
+               check_c_compiler_flag(${flag} c_flag_${flag}_supported)
+               if(c_flag_${flag}_supported)
+                       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+               endif(c_flag_${flag}_supported)
+               unset(c_flag_${flag}_supported)
+       endforeach()
+
+       foreach(flag IN LISTS proposed_cxx_flags)
+               check_cxx_compiler_flag(${flag} cxx_flag_${flag}_supported)
+               if(cxx_flag_${flag}_supported)
+                       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+               endif(cxx_flag_${flag}_supported)
+               unset(cxx_flag_${flag}_supported)
+       endforeach()
+
+       if(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
+               set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
+               set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
+               set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+       endif(("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU"))
+endmacro()
diff --git a/cmake/modules/UninstallTarget.cmake b/cmake/modules/UninstallTarget.cmake
new file mode 100644
index 0000000..7ccfcf3
--- /dev/null
+++ b/cmake/modules/UninstallTarget.cmake
@@ -0,0 +1,13 @@
+# UninstallTarget.cmake
+#
+# Defines a custom target named 'uninstall'
+
+if(NOT TARGET uninstall)
+       configure_file(
+               "${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+               "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake"
+               IMMEDIATE @ONLY)
+
+       add_custom_target(uninstall
+               COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake)
+endif(NOT TARGET uninstall)
diff --git a/cmake/verify-news-file.sh b/cmake/verify-news-file.sh
new file mode 100755
index 0000000..98d8191
--- /dev/null
+++ b/cmake/verify-news-file.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# Verifies that the NEWS file's first line contains correct version and date.
+# Requires arguments:
+#   $1 ... the NEWS file name, preferably with full path
+#   $2 ... expected version string, like "1.2.3"
+#
+# The date is expected in a form of YYYY-MM-DD of the current local time.
+# The NEWS line is in form of "PROJECTNAME VERSION DATE".
+#
+# The test can be skipped entirely when SKIP_NEWS_FILE_TEST=1 is set.
+
+FILENAME=$1
+EXPVERSION=$2
+
+if [ ! -f "$FILENAME" ]; then
+       echo "File '$FILENAME' does not exist" 1>&2
+       exit 1
+fi
+
+if [ -z "$EXPVERSION" ]; then
+       echo "Expected version argument not given or empty, use format '1.2.3'" 1>&2
+       exit 1
+fi
+
+NEWSLINE=`head --lines=1 "$FILENAME"`
+EXPDATE=`date +%Y-%m-%d`
+
+NEWSVERSION="${NEWSLINE#* }"
+NEWSDATE="${NEWSVERSION#* }"
+NEWSVERSION="${NEWSVERSION% *}"
+SUCCESS=1
+
+if [ "$NEWSVERSION" != "$EXPVERSION" ]; then
+       echo "Read NEWS version '$NEWSVERSION' doesn't match expected version '$EXPVERSION'" 1>&2
+       SUCCESS=0
+fi
+
+if [ "$NEWSDATE" != "$EXPDATE" ]; then
+       echo "Read NEWS date '$NEWSDATE' doesn't match expected date '$EXPDATE'" 1>&2
+       SUCCESS=0
+fi
+
+if [ "$SUCCESS" != "1" ]; then
+       if [ "$SKIP_NEWS_FILE_TEST" = "1" ]; then
+               echo "" 1>&2
+               echo "****************************************************************" 1>&2
+               echo "*  Failed NEWS file test ignored due to SKIP_NEWS_FILE_TEST=1  *" 1>&2
+               echo "****************************************************************" 1>&2
+               echo "" 1>&2
+               exit 0
+       else
+               echo "(This test can be skipped when SKIP_NEWS_FILE_TEST=1 is set.)" 1>&2
+       fi
+       exit 1
+fi
diff --git a/composer/CMakeLists.txt b/composer/CMakeLists.txt
new file mode 100644
index 0000000..1e82289
--- /dev/null
+++ b/composer/CMakeLists.txt
@@ -0,0 +1,85 @@
+add_error_files(composer mail-composer.error)
+
+install(FILES evolution-composer.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       email-engine
+       evolution-mail-formatter
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       e-composer-actions.c
+       e-composer-from-header.c
+       e-composer-header-table.c
+       e-composer-header.c
+       e-composer-name-header.c
+       e-composer-post-header.c
+       e-composer-private.c
+       e-composer-spell-header.c
+       e-composer-text-header.c
+       e-msg-composer.c
+)
+
+set(HEADERS
+       e-composer-actions.h
+       e-composer-common.h
+       e-composer-from-header.h
+       e-composer-header-table.h
+       e-composer-header.h
+       e-composer-name-header.h
+       e-composer-post-header.h
+       e-composer-private.h
+       e-composer-spell-header.h
+       e-composer-text-header.h
+       e-msg-composer.h
+)
+
+add_library(evolution-mail-composer SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-mail-composer
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-composer PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-mail-composer\"
+       -DEVOLUTION_UIDIR=\"${uidir}\"
+)
+
+target_compile_options(evolution-mail-composer PUBLIC
+       ${CERT_UI_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-composer PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CERT_UI_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-composer
+       ${DEPENDENCIES}
+       ${CERT_UI_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-composer
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/composer
+)
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c
index fa92322..5d88b76 100644
--- a/composer/e-composer-actions.c
+++ b/composer/e-composer-actions.c
@@ -15,9 +15,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-actions.h"
 #include "e-composer-private.h"
@@ -691,7 +689,7 @@ e_composer_actions_init (EMsgComposer *composer)
                e_html_editor_get_action (editor, "picture-gallery"), "sensitive",
                G_BINDING_SYNC_CREATE);
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
        visible = TRUE;
 #else
        visible = FALSE;
diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c
index ecc2985..dd530be 100644
--- a/composer/e-composer-from-header.c
+++ b/composer/e-composer-from-header.c
@@ -17,9 +17,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c
index 40b75aa..6b952c4 100644
--- a/composer/e-composer-header-table.c
+++ b/composer/e-composer-header-table.c
@@ -14,9 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-header-table.h"
 
diff --git a/composer/e-composer-header.c b/composer/e-composer-header.c
index d114297..7ea39cc 100644
--- a/composer/e-composer-header.c
+++ b/composer/e-composer-header.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-header.h"
 
diff --git a/composer/e-composer-name-header.c b/composer/e-composer-name-header.c
index d99b325..669a52f 100644
--- a/composer/e-composer-name-header.c
+++ b/composer/e-composer-name-header.c
@@ -17,9 +17,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-msg-composer.h"
 #include "e-composer-name-header.h"
diff --git a/composer/e-composer-post-header.c b/composer/e-composer-post-header.c
index 4c93ffd..e7f53b0 100644
--- a/composer/e-composer-post-header.c
+++ b/composer/e-composer-post-header.c
@@ -17,9 +17,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-post-header.h"
 
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 2b20b28..91aef51 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -16,9 +16,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-private.h"
 #include "e-composer-from-header.h"
diff --git a/composer/e-composer-spell-header.c b/composer/e-composer-spell-header.c
index b2d2dfa..5550fd0 100644
--- a/composer/e-composer-spell-header.c
+++ b/composer/e-composer-spell-header.c
@@ -14,9 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-spell-header.h"
 
diff --git a/composer/e-composer-text-header.c b/composer/e-composer-text-header.c
index f0bd6a3..78e1e84 100644
--- a/composer/e-composer-text-header.c
+++ b/composer/e-composer-text-header.c
@@ -18,9 +18,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-text-header.h"
 
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index a2a9b89..cb89c25 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -826,7 +824,7 @@ composer_build_message_pgp (AsyncContext *context,
        return TRUE;
 }
 
-#ifdef HAVE_SSL
+#ifdef ENABLE_SMIME
 static gboolean
 composer_build_message_smime (AsyncContext *context,
                               GCancellable *cancellable,
@@ -1029,12 +1027,12 @@ composer_build_message_thread (GSimpleAsyncResult *simple,
                return;
        }
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
        if (!composer_build_message_smime (context, cancellable, &error)) {
                g_simple_async_result_take_error (simple, error);
                return;
        }
-#endif /* HAVE_NSS */
+#endif /* ENABLE_SMIME */
 }
 
 static void
@@ -5069,7 +5067,7 @@ e_msg_composer_get_message (EMsgComposer *composer,
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
                flags |= COMPOSER_FLAG_PGP_ENCRYPT;
 
-#ifdef HAVE_NSS
+#ifdef ENABLE_SMIME
        action = ACTION (SMIME_SIGN);
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
                flags |= COMPOSER_FLAG_SMIME_SIGN;
@@ -5205,7 +5203,7 @@ e_msg_composer_get_message_draft (EMsgComposer *composer,
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
                flags |= COMPOSER_FLAG_PGP_ENCRYPT;
 
-#ifdef HAVE_NSS
+#ifdef ENABLE_SMIME
        action = ACTION (SMIME_SIGN);
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
                flags |= COMPOSER_FLAG_SMIME_SIGN;
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..d7897a5
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,127 @@
+/* @PROJECT_NAME@-config.h generated by CMake */
+
+/* Name of the package */
+#define PACKAGE "@PROJECT_NAME@"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "@PROJECT_BUGREPORT@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "@PROJECT_URL@"
+
+/* Version number of the project */
+#define VERSION "@PROJECT_VERSION@"
+
+/* Version substring, for packagers */
+#define VERSION_SUBSTRING "@VERSION_SUBSTRING@"
+
+/* Define if you want a comment appended to the version number */
+#define VERSION_COMMENT "@VERSION_COMMENT@"
+
+/* Define to the latest stable version if this version is unstable */
+#cmakedefine STABLE_VERSION "@STABLE_VERSION@"
+
+/* Base version (Major.Minor) */
+#define BASE_VERSION "@BASE_VERSION@"
+
+/* Package name for gettext */
+#define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@"
+
+/* Command to kill processes by name */
+#cmakedefine KILL_PROCESS_COMMAND "@KILL_PROCESS_COMMAND@"
+
+/* Define to 1 if you have the `nl_langinfo' function. */
+#cmakedefine HAVE_NL_LANGINFO 1
+
+/* Have nl_langinfo (_NL_MEASUREMENT_MEASUREMENT) */
+#cmakedefine HAVE__NL_MEASUREMENT_MEASUREMENT 1
+
+/* gnome-desktop */
+#cmakedefine HAVE_GNOME_DESKTOP 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#cmakedefine HAVE_SYS_WAIT_H 1
+
+/* Define if using Canberra and Canberra-GTK for sound */
+#cmakedefine HAVE_CANBERRA 1
+
+/* Define if gnome-autoar is enabled */
+#cmakedefine HAVE_AUTOAR 1
+
+/* Define if struct tm has a tm_gmtoff member */
+#cmakedefine HAVE_TM_GMTOFF 1
+
+/* Define if libc defines a timezone variable */
+#cmakedefine HAVE_TIMEZONE 1
+
+/* Define if libc defines an altzone variable */
+#cmakedefine HAVE_ALTZONE 1
+
+/* Define to 1 if you have the `mkdtemp' function. */
+#cmakedefine HAVE_MKDTEMP 1
+
+/* Define if you have the iso-codes package */
+#cmakedefine HAVE_ISO_CODES 1
+
+/* ISO codes prefix */
+#define ISO_CODES_PREFIX "@ISO_CODES_PREFIX@"
+
+/* defined if you have X11/XF86keysym.h */
+#cmakedefine HAVE_XFREE 1
+
+/* Define if using libcryptui */
+#cmakedefine HAVE_LIBCRYPTUI 1
+
+/* Define if TNEF attachments parser should be built */
+#cmakedefine ENABLE_YTNEF 1
+
+/* Define if TNEF include header is <ytnef.h> */
+#cmakedefine HAVE_YTNEF_H 1
+
+/* Define if TNEF include header is <libytnef/ytnef.h> */
+#cmakedefine HAVE_LIBYTNEF_YTNEF_H 1
+
+/* Bogofilter spam filtering program */
+#define BOGOFILTER_COMMAND "@BOGOFILTER_COMMAND@"
+
+/* SpamAssassin spam filtering program */
+#define SPAMASSASSIN_COMMAND "@SPAMASSASSIN_COMMAND@"
+
+/* SpamAssassin spam training program */
+#define SA_LEARN_COMMAND "@SA_LEARN_COMMAND@"
+
+/* Define if you have libnotify */
+#cmakedefine HAVE_LIBNOTIFY 1
+
+/* libical provides ical_set_unknown_token_handling_setting function */
+#cmakedefine HAVE_ICAL_UNKNOWN_TOKEN_HANDLING 1
+
+/* libical provides icaltzutil_set_exact_vtimezones_support function */
+#cmakedefine HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT 1
+
+/* When defined spell checking is enabled */
+#cmakedefine HAVE_GTKSPELL 1
+
+/* Source code highlighting utility */
+#cmakedefine HIGHLIGHT_COMMAND "@HIGHLIGHT_COMMAND@"
+
+/* When defined Contacts preview will contain maps */
+#cmakedefine ENABLE_CONTACT_MAPS 1
+
+/* Define to 1 if you have the `gnu_get_libc_version' function. */
+#cmakedefine HAVE_GNU_GET_LIBC_VERSION 1
+
+/* Define if SMIME should be enabled */
+#cmakedefine ENABLE_SMIME 1
+
+/* Define if you have LDAP support */
+#cmakedefine HAVE_LDAP 1
+
+/* Define if you use SunLDAP */
+/#cmakedefine SUNLDAP 1
+
+/* Define to the full path of mozilla nss library */
+#define MOZILLA_NSS_LIB_DIR "@MOZILLA_NSS_LIB_DIR@"
+
+/* When defined contacts preview will contain maps */
+#cmakedefine ENABLE_CONTACT_MAPS 1
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644
index 0000000..486e9b0
--- /dev/null
+++ b/data/CMakeLists.txt
@@ -0,0 +1,79 @@
+set(filedeps)
+set(autostartdir ${SYSCONF_INSTALL_DIR}/xdg/autostart)
+set(desktopdir ${SHARE_INSTALL_DIR}/applications)
+set(themedir ${privdatadir}/theme)
+
+configure_file(evolution.desktop.in.in
+       evolution.desktop.in
+       @ONLY
+)
+
+intltool_merge(${CMAKE_CURRENT_BINARY_DIR}/evolution.desktop.in evolution.desktop --desktop-style --utf8)
+
+list(APPEND filedeps ${CMAKE_CURRENT_BINARY_DIR}/evolution.desktop)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evolution.desktop
+       DESTINATION ${desktopdir}
+)
+
+configure_file(evolution-alarm-notify.desktop.in.in
+       evolution-alarm-notify.desktop.in
+       @ONLY
+)
+
+intltool_merge(${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify.desktop.in evolution-alarm-notify.desktop 
--desktop-style --utf8)
+
+list(APPEND filedeps ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify.desktop)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/evolution-alarm-notify.desktop
+       DESTINATION ${autostartdir}
+)
+
+install(FILES webview.css
+               webview-print.css
+       DESTINATION ${themedir}
+)
+
+set(SCHEMAS
+       org.gnome.evolution.gschema.xml
+       org.gnome.evolution.addressbook.gschema.xml
+       org.gnome.evolution.calendar.gschema.xml
+       org.gnome.evolution.importer.gschema.xml
+       org.gnome.evolution.mail.gschema.xml
+       org.gnome.evolution.shell.gschema.xml
+       org.gnome.evolution.bogofilter.gschema.xml
+       org.gnome.evolution.spamassassin.gschema.xml
+       org.gnome.evolution.plugin.attachment-reminder.gschema.xml
+       org.gnome.evolution.plugin.autocontacts.gschema.xml
+       org.gnome.evolution.plugin.email-custom-header.gschema.xml
+       org.gnome.evolution.plugin.external-editor.gschema.xml
+       org.gnome.evolution.plugin.face-picture.gschema.xml
+       org.gnome.evolution.plugin.itip.gschema.xml
+       org.gnome.evolution.plugin.mail-notification.gschema.xml
+       org.gnome.evolution.plugin.prefer-plain.gschema.xml
+       org.gnome.evolution.plugin.publish-calendar.gschema.xml
+       org.gnome.evolution.plugin.templates.gschema.xml
+)
+
+set(BUILT_SCHEMAS)
+foreach(_schema IN LISTS SCHEMAS)
+       intltool_merge(${_schema}.in ${_schema} --no-translations --xml-style --utf8)
+       list(APPEND BUILT_SCHEMAS ${CMAKE_CURRENT_BINARY_DIR}/${_schema})
+endforeach(_schema)
+
+add_custom_command(OUTPUT gschemas.compiled
+       COMMAND ${GLIB_COMPILE_SCHEMAS} .
+)
+
+add_custom_target(data-files ALL
+       DEPENDS gschemas.compiled
+               ${filedeps}
+)
+
+add_gsettings_schemas(data-files ${BUILT_SCHEMAS})
+
+install(FILES evolution.convert
+       DESTINATION ${SHARE_INSTALL_DIR}/GConf/gsettings
+)
+
+add_subdirectory(icons)
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
new file mode 100644
index 0000000..6d8585f
--- /dev/null
+++ b/data/icons/CMakeLists.txt
@@ -0,0 +1,234 @@
+set(public_icons
+       hicolor_apps_16x16_evolution.png
+       hicolor_apps_16x16_evolution-mail.png
+       hicolor_apps_16x16_evolution-memos.png
+       hicolor_apps_16x16_evolution-tasks.png
+       hicolor_apps_22x22_evolution.png
+       hicolor_apps_22x22_evolution-mail.png
+       hicolor_apps_22x22_evolution-memos.png
+       hicolor_apps_22x22_evolution-tasks.png
+       hicolor_apps_24x24_evolution.png
+       hicolor_apps_24x24_evolution-mail.png
+       hicolor_apps_24x24_evolution-memos.png
+       hicolor_apps_24x24_evolution-tasks.png
+       hicolor_apps_32x32_evolution.png
+       hicolor_apps_32x32_evolution-mail.png
+       hicolor_apps_32x32_evolution-memos.png
+       hicolor_apps_32x32_evolution-tasks.png
+       hicolor_apps_48x48_evolution.png
+       hicolor_apps_48x48_evolution-mail.png
+       hicolor_apps_48x48_evolution-memos.png
+       hicolor_apps_48x48_evolution-tasks.png
+       hicolor_apps_256x256_evolution.png
+       hicolor_apps_symbolic_evolution-symbolic.svg
+)
+
+# hicolor_status_16x16_wrapped.png was copied from Firefox
+# (toolkit/themes/gnomestripe/global/icons/wrap.png), which
+# contained the following notice:
+#
+#     All files in this directory are assumed to be licensed under the
+#     tri-license (MPL/GPL/LGPL) used throughout this codebase.
+#
+# There is no corresponding SVG file. */
+
+set(private_icons
+       hicolor_apps_16x16_contact-editor.png
+       hicolor_apps_16x16_im-aim.png
+       hicolor_apps_16x16_im-icq.png
+       hicolor_apps_16x16_im-jabber.png
+       hicolor_apps_16x16_im-msn.png
+       hicolor_apps_16x16_im-nov.png
+       hicolor_apps_16x16_im-yahoo.png
+       hicolor_apps_22x22_contact-editor.png
+       hicolor_apps_22x22_im-aim.png
+       hicolor_apps_22x22_im-icq.png
+       hicolor_apps_22x22_im-jabber.png
+       hicolor_apps_22x22_im-msn.png
+       hicolor_apps_22x22_im-nov.png
+       hicolor_apps_22x22_im-yahoo.png
+       hicolor_apps_24x24_contact-editor.png
+       hicolor_apps_24x24_im-aim.png
+       hicolor_apps_24x24_im-icq.png
+       hicolor_apps_24x24_im-jabber.png
+       hicolor_apps_24x24_im-msn.png
+       hicolor_apps_24x24_im-nov.png
+       hicolor_apps_24x24_im-yahoo.png
+       hicolor_apps_32x32_contact-editor.png
+       hicolor_apps_48x48_contact-editor.png
+       hicolor_apps_scalable_im-aim.svg
+       hicolor_apps_scalable_im-icq.svg
+       hicolor_apps_scalable_im-jabber.svg
+       hicolor_apps_scalable_im-msn.svg
+       hicolor_apps_scalable_im-nov.svg
+       hicolor_apps_scalable_im-yahoo.svg
+       hicolor_actions_16x16_folder-copy.png
+       hicolor_actions_16x16_folder-move.png
+       hicolor_actions_16x16_mail-archive.png
+       hicolor_actions_16x16_mail-copy.png
+       hicolor_actions_16x16_mail-move.png
+       hicolor_actions_16x16_go-today.png
+       hicolor_actions_16x16_view-calendar-day.png
+       hicolor_actions_16x16_view-calendar-list.png
+       hicolor_actions_16x16_view-calendar-month.png
+       hicolor_actions_16x16_view-calendar-week.png
+       hicolor_actions_16x16_view-calendar-workweek.png
+       hicolor_actions_22x22_go-today.png
+       hicolor_actions_22x22_view-calendar-day.png
+       hicolor_actions_22x22_view-calendar-list.png
+       hicolor_actions_22x22_view-calendar-month.png
+       hicolor_actions_22x22_view-calendar-week.png
+       hicolor_actions_22x22_view-calendar-workweek.png
+       hicolor_actions_24x24_go-today.png
+       hicolor_actions_24x24_mail-archive.png
+       hicolor_actions_24x24_query-free-busy.png
+       hicolor_actions_24x24_view-calendar-day.png
+       hicolor_actions_24x24_view-calendar-list.png
+       hicolor_actions_24x24_view-calendar-month.png
+       hicolor_actions_24x24_view-calendar-week.png
+       hicolor_actions_24x24_view-calendar-workweek.png
+       hicolor_actions_32x32_view-calendar-day.png
+       hicolor_actions_32x32_view-calendar-list.png
+       hicolor_actions_32x32_view-calendar-month.png
+       hicolor_actions_32x32_view-calendar-week.png
+       hicolor_actions_32x32_view-calendar-workweek.png
+       hicolor_actions_scalable_view-calendar-day.svg
+       hicolor_actions_scalable_view-calendar-list.svg
+       hicolor_actions_scalable_view-calendar-month.svg
+       hicolor_actions_scalable_view-calendar-week.svg
+       hicolor_actions_scalable_view-calendar-workweek.svg
+       hicolor_categories_48x48_preferences-autocompletion.png
+       hicolor_categories_48x48_preferences-calendar-and-tasks.png
+       hicolor_categories_48x48_preferences-certificates.png
+       hicolor_categories_48x48_preferences-composer.png
+       hicolor_categories_48x48_preferences-mail.png
+       hicolor_categories_48x48_preferences-mail-accounts.png
+       hicolor_categories_48x48_preferences-system-network-proxy.png
+       hicolor_places_16x16_mail-inbox.png
+       hicolor_places_16x16_mail-outbox.png
+       hicolor_places_16x16_mail-sent.png
+       hicolor_places_22x22_mail-inbox.png
+       hicolor_places_22x22_mail-outbox.png
+       hicolor_places_22x22_mail-sent.png
+       hicolor_places_24x24_mail-inbox.png
+       hicolor_places_24x24_mail-outbox.png
+       hicolor_places_24x24_mail-sent.png
+       hicolor_status_16x16_wrapped.png
+       hicolor_status_32x32_offline.png
+       hicolor_status_32x32_online.png
+)
+
+# These icons were in gnome-icon-theme prior to GNOME 2.30.
+# XXX Need to reevaluate which icons we really need and drop the rest.
+#     Many are not Tango-compliant and look dated and out of place.
+set(stock_private_icons
+       hicolor_actions_16x16_stock_bell.png
+       hicolor_actions_16x16_stock_contact-list.png
+       hicolor_actions_16x16_stock_insert-note.png
+       hicolor_actions_16x16_stock_insert-rule.png
+       hicolor_actions_16x16_stock_insert-table.png
+       hicolor_actions_16x16_stock_mail-filters-apply.png
+       hicolor_actions_16x16_stock_mail-flag-for-followup-done.png
+       hicolor_actions_16x16_stock_mail-flag-for-followup.png
+       hicolor_actions_16x16_stock_mail-open-multiple.png
+       hicolor_actions_16x16_stock_mail-unread-multiple.png
+       hicolor_actions_16x16_stock_new-24h-appointment.png
+       hicolor_actions_16x16_stock_notes.png
+       hicolor_actions_16x16_stock_people.png
+       hicolor_actions_16x16_stock_select-column.png
+       hicolor_actions_16x16_stock_select-row.png
+       hicolor_actions_16x16_stock_shared-by-me.png
+       hicolor_actions_16x16_stock_shared-to-me.png
+       hicolor_actions_16x16_stock_show-all.png
+       hicolor_actions_16x16_stock_task-assigned-to.png
+       hicolor_actions_16x16_stock_task-assigned.png
+       hicolor_actions_16x16_stock_task-recurring.png
+       hicolor_actions_16x16_stock_task.png
+       hicolor_actions_16x16_stock_text-monospaced.png
+       hicolor_actions_16x16_stock_timezone.png
+       hicolor_actions_16x16_stock_todo.png
+       hicolor_actions_16x16_stock_video-conferencing.png
+       hicolor_actions_16x16_stock_view-details.png
+       hicolor_actions_24x24_stock_new-24h-appointment.png
+       hicolor_actions_24x24_stock_contact-list.png
+       hicolor_actions_24x24_stock_insert-note.png
+       hicolor_actions_24x24_stock_insert-rule.png
+       hicolor_actions_24x24_stock_insert-table.png
+       hicolor_actions_24x24_stock_mail-filters-apply.png
+       hicolor_actions_24x24_stock_mail-open-multiple.png
+       hicolor_actions_24x24_stock_mail-unread-multiple.png
+       hicolor_actions_24x24_stock_notes.png
+       hicolor_actions_24x24_stock_people.png
+       hicolor_actions_24x24_stock_select-column.png
+       hicolor_actions_24x24_stock_select-row.png
+       hicolor_actions_24x24_stock_shared-by-me.png
+       hicolor_actions_24x24_stock_shared-to-me.png
+       hicolor_actions_24x24_stock_show-all.png
+       hicolor_actions_24x24_stock_task-assigned-to.png
+       hicolor_actions_24x24_stock_task-assigned.png
+       hicolor_actions_24x24_stock_task-recurring.png
+       hicolor_actions_24x24_stock_task.png
+       hicolor_actions_24x24_stock_text-monospaced.png
+       hicolor_actions_24x24_stock_timezone.png
+       hicolor_actions_24x24_stock_todo.png
+       hicolor_actions_24x24_stock_video-conferencing.png
+       hicolor_actions_48x48_stock_alarm.png
+       hicolor_actions_48x48_stock_mail-flag-for-followup-done.png
+       hicolor_actions_48x48_stock_mail-flag-for-followup.png
+       hicolor_actions_48x48_stock_new-24h-appointment.png
+       hicolor_actions_48x48_stock_notes.png
+       hicolor_actions_48x48_stock_people.png
+       hicolor_actions_48x48_stock_timezone.png
+       hicolor_actions_48x48_stock_todo.png
+       hicolor_status_16x16_stock_check-filled.png
+       hicolor_status_16x16_stock_score-high.png
+       hicolor_status_16x16_stock_score-higher.png
+       hicolor_status_16x16_stock_score-highest.png
+       hicolor_status_16x16_stock_score-low.png
+       hicolor_status_16x16_stock_score-lower.png
+       hicolor_status_16x16_stock_score-lowest.png
+       hicolor_status_16x16_stock_score-normal.png
+       hicolor_status_16x16_stock_signature-bad.png
+       hicolor_status_16x16_stock_signature-ok.png
+       hicolor_status_16x16_stock_signature.png
+       hicolor_status_24x24_stock_signature-bad.png
+       hicolor_status_24x24_stock_signature-ok.png
+       hicolor_status_24x24_stock_signature.png
+       hicolor_status_48x48_stock_signature-bad.png
+       hicolor_status_48x48_stock_signature-ok.png
+       hicolor_status_48x48_stock_signature.png
+)
+
+# These are source files for future editing
+# and are not meant to be installed as icons.
+set(noinst_icons
+       hicolor_apps_scalable_evolution.svg
+       hicolor_actions_16x16_go-today.svg
+       hicolor_actions_16x16_view-calendar-day.svg
+       hicolor_actions_16x16_view-calendar-list.svg
+       hicolor_actions_16x16_view-calendar-month.svg
+       hicolor_actions_16x16_view-calendar-week.svg
+       hicolor_actions_16x16_view-calendar-workweek.svg
+       hicolor_actions_22x22_go-today.svg
+       hicolor_actions_22x22_view-calendar-day.svg
+       hicolor_actions_22x22_view-calendar-list.svg
+       hicolor_actions_22x22_view-calendar-month.svg
+       hicolor_actions_22x22_view-calendar-week.svg
+       hicolor_actions_22x22_view-calendar-workweek.svg
+       hicolor_actions_32x32_view-calendar-day.svg
+       hicolor_actions_32x32_view-calendar-list.svg
+       hicolor_actions_32x32_view-calendar-month.svg
+       hicolor_actions_32x32_view-calendar-week.svg
+       hicolor_actions_32x32_view-calendar-workweek.svg
+       hicolor_places_16x16_mail-inbox.svg
+       hicolor_places_16x16_mail-outbox.svg
+       hicolor_places_16x16_mail-sent.svg
+       hicolor_places_22x22_mail-inbox.svg
+       hicolor_places_22x22_mail-outbox.svg
+       hicolor_places_22x22_mail-sent.svg
+       hicolor_status_32x32_offline.svg
+       hicolor_status_32x32_online.svg
+)
+
+add_icon_cache_files("${SHARE_INSTALL_DIR}" public_icons)
+add_icon_cache_files("${privdatadir}" private_icons stock_private_icons)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..90bb2b5
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(reference)
diff --git a/doc/reference/CMakeLists.txt b/doc/reference/CMakeLists.txt
new file mode 100644
index 0000000..cea870c
--- /dev/null
+++ b/doc/reference/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory(evolution-mail-composer)
+add_subdirectory(evolution-mail-engine)
+add_subdirectory(evolution-mail-formatter)
+add_subdirectory(evolution-shell)
+add_subdirectory(evolution-util)
diff --git a/doc/reference/evolution-mail-composer/CMakeLists.txt 
b/doc/reference/evolution-mail-composer/CMakeLists.txt
new file mode 100644
index 0000000..ddc9fe2
--- /dev/null
+++ b/doc/reference/evolution-mail-composer/CMakeLists.txt
@@ -0,0 +1,14 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/composer
+)
+
+set(DEPENDENCIES
+       evolution-mail-composer
+)
+
+set(IGNORE_HEADERS
+       e-composer-actions.h
+       e-composer-private.h
+)
+
+add_gtkdoc(evolution-mail-composer composer "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml 
b/doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
similarity index 93%
rename from doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml
rename to doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
index fb2de95..207cbcd 100644
--- a/doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml
+++ b/doc/reference/evolution-mail-composer/evolution-mail-composer-docs.sgml.in
@@ -25,11 +25,6 @@
     <xi:include href="xml/e-composer-text-header.xml"/>
   </chapter>
 
-  <chapter id="object-tree">
-    <title>Object Hierarchy</title>
-     <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
-
   <index id="api-index-full">
     <title>API Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/doc/reference/evolution-mail-engine/CMakeLists.txt 
b/doc/reference/evolution-mail-engine/CMakeLists.txt
new file mode 100644
index 0000000..73acf50
--- /dev/null
+++ b/doc/reference/evolution-mail-engine/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/libemail-engine
+)
+
+set(DEPENDENCIES
+       email-engine
+)
+
+set(IGNORE_HEADERS
+       e-mail-engine-enumtypes.h
+)
+
+add_gtkdoc(evolution-mail-engine email-engine "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml 
b/doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
similarity index 94%
rename from doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml
rename to doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
index 8b3855f..01b7a03 100644
--- a/doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml
+++ b/doc/reference/evolution-mail-engine/evolution-mail-engine-docs.sgml.in
@@ -44,11 +44,6 @@
     <xi:include href="xml/mail-vfolder.xml"/>
   </chapter>
 
-  <chapter id="object-tree">
-    <title>Object Hierarchy</title>
-    <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
-
   <index id="api-index-full">
     <title>API Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/doc/reference/evolution-mail-formatter/CMakeLists.txt 
b/doc/reference/evolution-mail-formatter/CMakeLists.txt
new file mode 100644
index 0000000..4946326
--- /dev/null
+++ b/doc/reference/evolution-mail-formatter/CMakeLists.txt
@@ -0,0 +1,13 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/em-format
+)
+
+set(DEPENDENCIES
+       evolution-mail-formatter
+)
+
+set(IGNORE_HEADERS
+       e-mail-formatter-enumtypes.h
+)
+
+add_gtkdoc(evolution-mail-formatter em-format "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml 
b/doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
similarity index 94%
rename from doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml
rename to doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
index 04af4fd..0465e0c 100644
--- a/doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml
+++ b/doc/reference/evolution-mail-formatter/evolution-mail-formatter-docs.sgml.in
@@ -44,11 +44,6 @@
     <xi:include href="xml/e-mail-part-utils.xml"/>
   </chapter>
 
-  <chapter id="object-tree">
-    <title>Object Hierarchy</title>
-    <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
-
   <index id="api-index-full">
     <title>Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/doc/reference/evolution-shell/CMakeLists.txt b/doc/reference/evolution-shell/CMakeLists.txt
new file mode 100644
index 0000000..d597cad
--- /dev/null
+++ b/doc/reference/evolution-shell/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/shell
+)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-util
+       evolution-shell
+)
+
+set(IGNORE_HEADERS
+       evo-version.h
+       e-shell-window-private.h
+       e-shell-enumtypes.h
+)
+
+add_gtkdoc(evolution-shell shell "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-shell/evolution-shell-docs.sgml 
b/doc/reference/evolution-shell/evolution-shell-docs.sgml.in
similarity index 94%
rename from doc/reference/evolution-shell/evolution-shell-docs.sgml
rename to doc/reference/evolution-shell/evolution-shell-docs.sgml.in
index 3e03902..62cf28f 100644
--- a/doc/reference/evolution-shell/evolution-shell-docs.sgml
+++ b/doc/reference/evolution-shell/evolution-shell-docs.sgml.in
@@ -37,11 +37,6 @@
     <xi:include href="xml/e-shell-migrate.xml"/>
   </chapter>
 
-  <chapter id="object-tree">
-    <title>Object Hierarchy</title>
-    <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
-
   <index id="api-index-full">
     <title>Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/doc/reference/evolution-util/CMakeLists.txt b/doc/reference/evolution-util/CMakeLists.txt
new file mode 100644
index 0000000..4f499c5
--- /dev/null
+++ b/doc/reference/evolution-util/CMakeLists.txt
@@ -0,0 +1,49 @@
+set(SOURCEDIRS
+       ${CMAKE_SOURCE_DIR}/e-util
+)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-util
+       evolution-shell
+)
+
+set(IGNORE_HEADERS
+       e-html-editor-actions.h
+       e-html-editor-private.h
+       e-marshal.h
+       e-table-col-dnd.h
+       e-table-defines.h
+       e-util-enumtypes.h
+       e-util-private.h
+       ea-calendar-cell.h
+       ea-calendar-item.h
+       ea-cell-table.h
+       ea-factory.h
+       ea-widgets.h
+       gal-a11y-e-cell.h
+       gal-a11y-e-cell-popup.h
+       gal-a11y-e-cell-registry.h
+       gal-a11y-e-cell-text.h
+       gal-a11y-e-cell-toggle.h
+       gal-a11y-e-cell-tree.h
+       gal-a11y-e-cell-vbox.h
+       gal-a11y-e-table-click-to-add-factory.h
+       gal-a11y-e-table-click-to-add.h
+       gal-a11y-e-table-column-header.h
+       gal-a11y-e-table-factory.h
+       gal-a11y-e-table-item-factory.h
+       gal-a11y-e-table-item.h
+       gal-a11y-e-table.h
+       gal-a11y-e-text-factory.h
+       gal-a11y-e-text.h
+       gal-a11y-e-tree-factory.h
+       gal-a11y-e-tree.h
+       gal-a11y-factory.h
+       gal-a11y-util.h
+       test-html-editor-units-bugs.h
+       test-html-editor-units-utils.h
+       test-keyfile-settings-backend.h
+)
+
+add_gtkdoc(evolution-util e-util "" SOURCEDIRS DEPENDENCIES IGNORE_HEADERS)
diff --git a/doc/reference/evolution-util/evolution-util-docs.sgml 
b/doc/reference/evolution-util/evolution-util-docs.sgml.in
similarity index 99%
rename from doc/reference/evolution-util/evolution-util-docs.sgml
rename to doc/reference/evolution-util/evolution-util-docs.sgml.in
index a7e12f8..3664898 100644
--- a/doc/reference/evolution-util/evolution-util-docs.sgml
+++ b/doc/reference/evolution-util/evolution-util-docs.sgml.in
@@ -313,11 +313,6 @@
     <xi:include href="xml/e-widget-undo.xml"/>
   </chapter>
 
-  <chapter id="object-tree">
-    <title>Object Hierarchy</title>
-    <xi:include href="xml/tree_index.sgml"/>
-  </chapter>
-
   <index id="api-index-full">
     <title>Index</title>
     <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
diff --git a/e-util/CMakeLists.txt b/e-util/CMakeLists.txt
new file mode 100644
index 0000000..c0cad5e
--- /dev/null
+++ b/e-util/CMakeLists.txt
@@ -0,0 +1,769 @@
+glib_mkenums(e-util-enumtypes e-util-enums.h E_UTIL_ENUMTYPES_H)
+glib_genmarshal(e-marshal e_marshal e-marshal.list)
+
+add_error_files(e-util
+       e-system.error
+       filter.error
+       widgets.error
+)
+
+set(uifiles
+       e-html-editor-manager.ui
+       e-send-options.ui
+       e-table-config.ui
+       e-timezone-dialog.ui
+       filter.ui
+       gal-view-instance-save-as-dialog.ui
+)
+
+install(FILES ${uifiles}
+       DESTINATION ${uidir}
+)
+
+set(PLATFORM_SOURCES)
+
+if(WIN32)
+       set(PLATFORM_SOURCES
+               e-win32-reloc.c
+               e-win32-defaults.c
+               e-win32-defaults.h
+       )
+endif(WIN32)
+
+# Main libevolution-util
+
+set(DEPENDENCIES
+       gnomecanvas
+)
+
+set(SOURCES
+       e-action-combo-box.c
+       e-activity-bar.c
+       e-activity-proxy.c
+       e-activity.c
+       e-alarm-selector.c
+       e-alert-bar.c
+       e-alert-dialog.c
+       e-alert-sink.c
+       e-alert.c
+       e-attachment-bar.c
+       e-attachment-dialog.c
+       e-attachment-handler-image.c
+       e-attachment-handler.c
+       e-attachment-icon-view.c
+       e-attachment-paned.c
+       e-attachment-store.c
+       e-attachment-tree-view.c
+       e-attachment-view.c
+       e-attachment.c
+       e-auth-combo-box.c
+       e-autocomplete-selector.c
+       e-bit-array.c
+       e-book-source-config.c
+       e-buffer-tagger.c
+       e-cal-source-config.c
+       e-calendar-item.c
+       e-calendar.c
+       e-canvas-background.c
+       e-canvas-utils.c
+       e-canvas-vbox.c
+       e-canvas.c
+       e-categories-config.c
+       e-categories-dialog.c
+       e-categories-editor.c
+       e-categories-selector.c
+       e-category-completion.c
+       e-category-editor.c
+       e-cell-checkbox.c
+       e-cell-combo.c
+       e-cell-date-edit.c
+       e-cell-date-int.c
+       e-cell-date.c
+       e-cell-hbox.c
+       e-cell-number.c
+       e-cell-percent.c
+       e-cell-pixbuf.c
+       e-cell-popup.c
+       e-cell-size.c
+       e-cell-text.c
+       e-cell-toggle.c
+       e-cell-tree.c
+       e-cell-vbox.c
+       e-cell.c
+       e-charset-combo-box.c
+       e-charset.c
+       e-client-cache.c
+       e-client-combo-box.c
+       e-client-selector.c
+       e-color-chooser-widget.c
+       e-color-combo.c
+       e-config.c
+       e-conflict-search-selector.c
+       e-contact-store.c
+       e-content-editor.c
+       e-content-request.c
+       e-data-capture.c
+       e-dateedit.c
+       e-datetime-format.c
+       e-destination-store.c
+       e-dialog-utils.c
+       e-dialog-widgets.c
+       e-emoticon-action.c
+       e-emoticon-chooser-menu.c
+       e-emoticon-chooser.c
+       e-emoticon-tool-button.c
+       e-emoticon.c
+       e-event.c
+       e-file-request.c
+       e-file-utils.c
+       e-filter-code.c
+       e-filter-color.c
+       e-filter-datespec.c
+       e-filter-element.c
+       e-filter-file.c
+       e-filter-input.c
+       e-filter-int.c
+       e-filter-option.c
+       e-filter-part.c
+       e-filter-rule.c
+       e-focus-tracker.c
+       e-html-editor-actions.c
+       e-html-editor-cell-dialog.c
+       e-html-editor-dialog.c
+       e-html-editor-find-dialog.c
+       e-html-editor-hrule-dialog.c
+       e-html-editor-image-dialog.c
+       e-html-editor-link-dialog.c
+       e-html-editor-page-dialog.c
+       e-html-editor-paragraph-dialog.c
+       e-html-editor-private.h
+       e-html-editor-replace-dialog.c
+       e-html-editor-spell-check-dialog.c
+       e-html-editor-table-dialog.c
+       e-html-editor-text-dialog.c
+       e-html-editor.c
+       e-html-utils.c
+       e-icon-factory.c
+       e-image-chooser.c
+       e-image-chooser-dialog.c
+       e-import-assistant.c
+       e-import.c
+       e-interval-chooser.c
+       e-mail-identity-combo-box.c
+       e-mail-signature-combo-box.c
+       e-mail-signature-editor.c
+       e-mail-signature-manager.c
+       e-mail-signature-preview.c
+       e-mail-signature-script-dialog.c
+       e-mail-signature-tree-view.c
+       e-map.c
+       e-marshal.c
+       e-menu-tool-action.c
+       e-menu-tool-button.c
+       e-misc-utils.c
+       e-mktemp.c
+       e-name-selector-dialog.c
+       e-name-selector-entry.c
+       e-name-selector-list.c
+       e-name-selector-model.c
+       e-name-selector.c
+       e-online-button.c
+       e-paned.c
+       e-passwords.c
+       e-photo-cache.c
+       e-photo-source.c
+       e-picture-gallery.c
+       e-plugin-ui.c
+       e-plugin.c
+       e-poolv.c
+       e-popup-action.c
+       e-popup-menu.c
+       e-port-entry.c
+       e-preferences-window.c
+       e-preview-pane.c
+       e-print.c
+       e-printable.c
+       e-proxy-combo-box.c
+       e-proxy-editor.c
+       e-proxy-link-selector.c
+       e-proxy-preferences.c
+       e-proxy-selector.c
+       e-reflow-model.c
+       e-reflow.c
+       e-rule-context.c
+       e-rule-editor.c
+       e-search-bar.c
+       e-selectable.c
+       e-selection-model-array.c
+       e-selection-model-simple.c
+       e-selection-model.c
+       e-selection.c
+       e-send-options.c
+       e-simple-async-result.c
+       e-sorter-array.c
+       e-sorter.c
+       e-source-combo-box.c
+       e-source-config-backend.c
+       e-source-config-dialog.c
+       e-source-config.c
+       e-source-conflict-search.c
+       e-source-selector-dialog.c
+       e-source-selector.c
+       e-source-util.c
+       e-spell-checker.c
+       e-spell-dictionary.c
+       e-spell-entry.c
+       e-spell-text-view.c
+       e-spinner.c
+       e-stock-request.c
+       e-table-click-to-add.c
+       e-table-col.c
+       e-table-column-selector.c
+       e-table-column-specification.c
+       e-table-config.c
+       e-table-extras.c
+       e-table-field-chooser-dialog.c
+       e-table-field-chooser-item.c
+       e-table-field-chooser.c
+       e-table-group-container.c
+       e-table-group-leaf.c
+       e-table-group.c
+       e-table-header-item.c
+       e-table-header-utils.c
+       e-table-header.c
+       e-table-item.c
+       e-table-model.c
+       e-table-one.c
+       e-table-search.c
+       e-table-selection-model.c
+       e-table-sort-info.c
+       e-table-sorted-variable.c
+       e-table-sorted.c
+       e-table-sorter.c
+       e-table-sorting-utils.c
+       e-table-specification.c
+       e-table-state.c
+       e-table-subset-variable.c
+       e-table-subset.c
+       e-table-utils.c
+       e-table.c
+       e-text-event-processor-emacs-like.c
+       e-text-event-processor.c
+       e-text-model-repos.c
+       e-text-model.c
+       e-text.c
+       e-timezone-dialog.c
+       e-tree-model-generator.c
+       e-tree-model.c
+       e-tree-selection-model.c
+       e-tree-table-adapter.c
+       e-tree-view-frame.c
+       e-tree.c
+       e-unicode.c
+       e-url-entry.c
+       e-util-private.h
+       e-web-view-preview.c
+       e-web-view.c
+       e-widget-undo.c
+       e-xml-utils.c
+       ea-calendar-cell.c
+       ea-calendar-item.c
+       ea-cell-table.c
+       ea-widgets.c
+       gal-a11y-e-cell-popup.c
+       gal-a11y-e-cell-registry.c
+       gal-a11y-e-cell-text.c
+       gal-a11y-e-cell-toggle.c
+       gal-a11y-e-cell-tree.c
+       gal-a11y-e-cell-vbox.c
+       gal-a11y-e-cell.c
+       gal-a11y-e-table-click-to-add-factory.c
+       gal-a11y-e-table-click-to-add.c
+       gal-a11y-e-table-column-header.c
+       gal-a11y-e-table-factory.c
+       gal-a11y-e-table-item-factory.c
+       gal-a11y-e-table-item.c
+       gal-a11y-e-table.c
+       gal-a11y-e-text-factory.c
+       gal-a11y-e-text.c
+       gal-a11y-e-tree-factory.c
+       gal-a11y-e-tree.c
+       gal-a11y-util.c
+       gal-view-collection.c
+       gal-view-etable.c
+       gal-view-instance-save-as-dialog.c
+       gal-view-instance.c
+       gal-view.c
+       ${PLATFORM_SOURCES}
+       ${CMAKE_CURRENT_BINARY_DIR}/e-marshal.c
+       ${CMAKE_CURRENT_BINARY_DIR}/e-util-enumtypes.c
+)
+
+set(HEADERS
+       e-util.h
+       e-action-combo-box.h
+       e-activity-bar.h
+       e-activity-proxy.h
+       e-activity.h
+       e-alarm-selector.h
+       e-alert-bar.h
+       e-alert-dialog.h
+       e-alert-sink.h
+       e-alert.h
+       e-attachment-bar.h
+       e-attachment-dialog.h
+       e-attachment-handler-image.h
+       e-attachment-handler.h
+       e-attachment-icon-view.h
+       e-attachment-paned.h
+       e-attachment-store.h
+       e-attachment-tree-view.h
+       e-attachment-view.h
+       e-attachment.h
+       e-auth-combo-box.h
+       e-autocomplete-selector.h
+       e-bit-array.h
+       e-book-source-config.h
+       e-buffer-tagger.h
+       e-cal-source-config.h
+       e-calendar-item.h
+       e-calendar.h
+       e-canvas-background.h
+       e-canvas-utils.h
+       e-canvas-vbox.h
+       e-canvas.h
+       e-categories-config.h
+       e-categories-dialog.h
+       e-categories-editor.h
+       e-categories-selector.h
+       e-category-completion.h
+       e-category-editor.h
+       e-cell-checkbox.h
+       e-cell-combo.h
+       e-cell-date-edit.h
+       e-cell-date-int.h
+       e-cell-date.h
+       e-cell-hbox.h
+       e-cell-number.h
+       e-cell-percent.h
+       e-cell-pixbuf.h
+       e-cell-popup.h
+       e-cell-size.h
+       e-cell-text.h
+       e-cell-toggle.h
+       e-cell-tree.h
+       e-cell-vbox.h
+       e-cell.h
+       e-charset-combo-box.h
+       e-charset.h
+       e-client-cache.h
+       e-client-combo-box.h
+       e-client-selector.h
+       e-color-chooser-widget.h
+       e-color-combo.h
+       e-config.h
+       e-conflict-search-selector.h
+       e-contact-store.h
+       e-content-editor.h
+       e-content-request.h
+       e-data-capture.h
+       e-dateedit.h
+       e-datetime-format.h
+       e-destination-store.h
+       e-dialog-utils.h
+       e-dialog-widgets.h
+       e-emoticon-action.h
+       e-emoticon-chooser-menu.h
+       e-emoticon-chooser.h
+       e-emoticon-tool-button.h
+       e-emoticon.h
+       e-event.h
+       e-file-request.h
+       e-file-utils.h
+       e-filter-code.h
+       e-filter-color.h
+       e-filter-datespec.h
+       e-filter-element.h
+       e-filter-file.h
+       e-filter-input.h
+       e-filter-int.h
+       e-filter-option.h
+       e-filter-part.h
+       e-filter-rule.h
+       e-focus-tracker.h
+       e-html-editor-actions.h
+       e-html-editor-cell-dialog.h
+       e-html-editor-dialog.h
+       e-html-editor-find-dialog.h
+       e-html-editor-hrule-dialog.h
+       e-html-editor-image-dialog.h
+       e-html-editor-link-dialog.h
+       e-html-editor-page-dialog.h
+       e-html-editor-paragraph-dialog.h
+       e-html-editor-replace-dialog.h
+       e-html-editor-spell-check-dialog.h
+       e-html-editor-table-dialog.h
+       e-html-editor-text-dialog.h
+       e-html-editor.h
+       e-html-utils.h
+       e-icon-factory.h
+       e-image-chooser.h
+       e-image-chooser-dialog.h
+       e-import-assistant.h
+       e-import.h
+       e-interval-chooser.h
+       e-mail-identity-combo-box.h
+       e-mail-signature-combo-box.h
+       e-mail-signature-editor.h
+       e-mail-signature-manager.h
+       e-mail-signature-preview.h
+       e-mail-signature-script-dialog.h
+       e-mail-signature-tree-view.h
+       e-map.h
+       e-menu-tool-action.h
+       e-menu-tool-button.h
+       e-misc-utils.h
+       e-mktemp.h
+       e-name-selector-dialog.h
+       e-name-selector-entry.h
+       e-name-selector-list.h
+       e-name-selector-model.h
+       e-name-selector.h
+       e-online-button.h
+       e-paned.h
+       e-passwords.h
+       e-photo-cache.h
+       e-photo-source.h
+       e-picture-gallery.h
+       e-plugin-ui.h
+       e-plugin.h
+       e-poolv.h
+       e-popup-action.h
+       e-popup-menu.h
+       e-port-entry.h
+       e-preferences-window.h
+       e-preview-pane.h
+       e-print.h
+       e-printable.h
+       e-proxy-combo-box.h
+       e-proxy-editor.h
+       e-proxy-link-selector.h
+       e-proxy-preferences.h
+       e-proxy-selector.h
+       e-reflow-model.h
+       e-reflow.h
+       e-rule-context.h
+       e-rule-editor.h
+       e-search-bar.h
+       e-selectable.h
+       e-selection-model-array.h
+       e-selection-model-simple.h
+       e-selection-model.h
+       e-selection.h
+       e-send-options.h
+       e-simple-async-result.h
+       e-sorter-array.h
+       e-sorter.h
+       e-source-combo-box.h
+       e-source-config-backend.h
+       e-source-config-dialog.h
+       e-source-config.h
+       e-source-conflict-search.h
+       e-source-selector-dialog.h
+       e-source-selector.h
+       e-source-util.h
+       e-spell-checker.h
+       e-spell-dictionary.h
+       e-spell-entry.h
+       e-spell-text-view.h
+       e-spinner.h
+       e-stock-request.h
+       e-table-click-to-add.h
+       e-table-col-dnd.h
+       e-table-col.h
+       e-table-column-selector.h
+       e-table-column-specification.h
+       e-table-config.h
+       e-table-defines.h
+       e-table-extras.h
+       e-table-field-chooser-dialog.h
+       e-table-field-chooser-item.h
+       e-table-field-chooser.h
+       e-table-group-container.h
+       e-table-group-leaf.h
+       e-table-group.h
+       e-table-header-item.h
+       e-table-header-utils.h
+       e-table-header.h
+       e-table-item.h
+       e-table-model.h
+       e-table-one.h
+       e-table-search.h
+       e-table-selection-model.h
+       e-table-sort-info.h
+       e-table-sorted-variable.h
+       e-table-sorted.h
+       e-table-sorter.h
+       e-table-sorting-utils.h
+       e-table-specification.h
+       e-table-state.h
+       e-table-subset-variable.h
+       e-table-subset.h
+       e-table-utils.h
+       e-table.h
+       e-text-event-processor-emacs-like.h
+       e-text-event-processor-types.h
+       e-text-event-processor.h
+       e-text-model-repos.h
+       e-text-model.h
+       e-text.h
+       e-timezone-dialog.h
+       e-tree-model-generator.h
+       e-tree-model.h
+       e-tree-selection-model.h
+       e-tree-table-adapter.h
+       e-tree-view-frame.h
+       e-tree.h
+       e-unicode.h
+       e-url-entry.h
+       e-util-enums.h
+       e-web-view-preview.h
+       e-web-view.h
+       e-widget-undo.h
+       e-xml-utils.h
+       ea-calendar-cell.h
+       ea-calendar-item.h
+       ea-cell-table.h
+       ea-factory.h
+       ea-widgets.h
+       gal-a11y-e-cell-popup.h
+       gal-a11y-e-cell-registry.h
+       gal-a11y-e-cell-text.h
+       gal-a11y-e-cell-toggle.h
+       gal-a11y-e-cell-tree.h
+       gal-a11y-e-cell-vbox.h
+       gal-a11y-e-cell.h
+       gal-a11y-e-table-click-to-add-factory.h
+       gal-a11y-e-table-click-to-add.h
+       gal-a11y-e-table-column-header.h
+       gal-a11y-e-table-factory.h
+       gal-a11y-e-table-item-factory.h
+       gal-a11y-e-table-item.h
+       gal-a11y-e-table.h
+       gal-a11y-e-text-factory.h
+       gal-a11y-e-text.h
+       gal-a11y-e-tree-factory.h
+       gal-a11y-e-tree.h
+       gal-a11y-factory.h
+       gal-a11y-util.h
+       gal-view-collection.h
+       gal-view-etable.h
+       gal-view-instance-save-as-dialog.h
+       gal-view-instance.h
+       gal-view.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-marshal.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-util-enumtypes.h
+)
+
+add_library(evolution-util SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-util
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-util PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-util\"
+       -DEVOLUTION_BINDIR=\"${BIN_INSTALL_DIR}\"
+       -DEVOLUTION_DATADIR=\"${SHARE_INSTALL_DIR}\"
+       -DEVOLUTION_ECPSDIR=\"${privdatadir}/ecps\"
+       -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+       -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+       -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+       -DEVOLUTION_ICONDIR=\"${icondir}\"
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+       -DEVOLUTION_LIBDIR=\"${LIB_INSTALL_DIR}\"
+       -DEVOLUTION_LIBEXECDIR=\"${privlibexecdir}\"
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+       -DEVOLUTION_PLUGINDIR=\"${plugindir}\"
+       -DEVOLUTION_PREFIX=\"${CMAKE_INSTALL_PREFIX}\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+       -DEVOLUTION_SOUNDDIR=\"${soundsdir}\"
+       -DEVOLUTION_SYSCONFDIR=\"${SYSCONF_INSTALL_DIR}\"
+       -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+       -DEVOLUTION_UIDIR=\"${uidir}\"
+       -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+       -DEVOLUTION_WEB_EXTENSIONS_DIR=\"${webextensionsdir}\"
+       -DEVOLUTION_TESTGIOMODULESDIR=\"${CMAKE_CURRENT_BINARY_DIR}\"
+       -DEVOLUTION_TESTTOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"
+       -DLIBEUTIL_COMPILATION
+)
+
+target_compile_options(evolution-util PUBLIC
+       ${AUTOAR_CFLAGS}
+       ${ENCHANT_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GEO_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${GTKSPELL_CFLAGS}
+)
+
+target_include_directories(evolution-util PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${AUTOAR_INCLUDE_DIRS}
+       ${ENCHANT_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GEO_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${GTKSPELL_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-util
+       ${DEPENDENCIES}
+       ${AUTOAR_LDFLAGS}
+       ${ENCHANT_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GEO_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${GTKSPELL_LDFLAGS}
+       ${ICONV_LIBS}
+       ${MATH_LDFLAGS}
+)
+
+install(TARGETS evolution-util
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/e-util
+)
+
+# Private gsettings module
+
+# This is not meant to be distributed to end users, unless test-html-editor-units
+# is also distributed, but even then it can work without it
+add_library(evolutiontestsettings MODULE
+       test-keyfile-settings-backend.h
+       test-keyfile-settings-backend.c
+       ${PLATFORM_SOURCES}
+)
+
+target_compile_definitions(evolutiontestsettings PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-test-settings\"
+)
+
+target_compile_options(evolutiontestsettings PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+)
+
+target_include_directories(evolutiontestsettings PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_CURRENT_SOURCE_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolutiontestsettings
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+)
+
+# Private test programs
+
+macro(add_private_program _name _sources)
+       set(DEPENDENCIES
+               evolution-util
+       )
+
+       set(SOURCES)
+       foreach(_src ${_sources} ${ARGN})
+               list(APPEND SOURCES ${_src})
+       endforeach(_src)
+
+       add_executable(${_name}
+               ${SOURCES}
+       )
+
+       add_dependencies(${_name}
+               ${DEPENDENCIES}
+       )
+
+       target_compile_definitions(${_name} PRIVATE
+               -DG_LOG_DOMAIN=\"${_name}\"
+               -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+               -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+               -DEVOLUTION_TESTGIOMODULESDIR=\"${CMAKE_CURRENT_BINARY_DIR}\"
+               -DEVOLUTION_TESTTOPSRCDIR=\"${CMAKE_SOURCE_DIR}\"
+               -DLIBEUTIL_COMPILATION
+       )
+
+       target_compile_options(${_name} PUBLIC
+               ${AUTOAR_CFLAGS}
+               ${ENCHANT_CFLAGS}
+               ${EVOLUTION_DATA_SERVER_CFLAGS}
+               ${GEO_CFLAGS}
+               ${GNOME_PLATFORM_CFLAGS}
+               ${GTKSPELL_CFLAGS}
+       )
+
+       target_include_directories(${_name} PUBLIC
+               ${CMAKE_BINARY_DIR}
+               ${CMAKE_SOURCE_DIR}
+               ${CMAKE_CURRENT_BINARY_DIR}
+               ${AUTOAR_INCLUDE_DIRS}
+               ${ENCHANT_INCLUDE_DIRS}
+               ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+               ${GEO_INCLUDE_DIRS}
+               ${GNOME_PLATFORM_INCLUDE_DIRS}
+               ${GTKSPELL_INCLUDE_DIRS}
+       )
+
+       target_link_libraries(${_name}
+               ${DEPENDENCIES}
+               ${AUTOAR_LDFLAGS}
+               ${ENCHANT_LDFLAGS}
+               ${EVOLUTION_DATA_SERVER_LDFLAGS}
+               ${GEO_LDFLAGS}
+               ${GNOME_PLATFORM_LDFLAGS}
+               ${GTKSPELL_LDFLAGS}
+               ${ICONV_LIBS}
+               ${MATH_LDFLAGS}
+       )
+endmacro(add_private_program)
+
+macro(add_private_programs_simple _name0)
+       foreach(_name ${_name0} ${ARGN})
+               add_private_program(${_name} ${_name}.c)
+       endforeach(_name)
+endmacro(add_private_programs_simple)
+
+add_private_programs_simple(
+       evolution-source-viewer
+       test-calendar
+       test-category-completion
+       test-contact-store
+       test-dateedit
+       test-html-editor
+       test-mail-signatures
+       test-name-selector
+       test-preferences-window
+       test-proxy-preferences
+       test-source-combo-box
+       test-source-config
+       test-source-selector
+       test-tree-view-frame
+)
+
+add_private_program(test-html-editor-units
+       test-html-editor-units.c
+       test-html-editor-units-bugs.h
+       test-html-editor-units-bugs.c
+       test-html-editor-units-utils.h
+       test-html-editor-units-utils.c
+)
+add_dependencies(test-html-editor-units evolutiontestsettings)
diff --git a/e-util/e-action-combo-box.c b/e-util/e-action-combo-box.c
index 33d678a..c69e8fa 100644
--- a/e-util/e-action-combo-box.c
+++ b/e-util/e-action-combo-box.c
@@ -16,9 +16,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-action-combo-box.h"
 #include "e-misc-utils.h"
diff --git a/e-util/e-activity-bar.c b/e-util/e-activity-bar.c
index 33145e5..0d14871 100644
--- a/e-util/e-activity-bar.c
+++ b/e-util/e-activity-bar.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <libedataserver/libedataserver.h>
diff --git a/e-util/e-activity-proxy.c b/e-util/e-activity-proxy.c
index 33aa7f0..347b70d 100644
--- a/e-util/e-activity-proxy.c
+++ b/e-util/e-activity-proxy.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/e-util/e-activity.c b/e-util/e-activity.c
index 010a114..8adc210 100644
--- a/e-util/e-activity.c
+++ b/e-util/e-activity.c
@@ -27,9 +27,7 @@
  * button which is linked to a #GCancellable.
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-activity.h"
 
diff --git a/e-util/e-alert-bar.c b/e-util/e-alert-bar.c
index 56cdf21..9acd9dd 100644
--- a/e-util/e-alert-bar.c
+++ b/e-util/e-alert-bar.c
@@ -15,12 +15,12 @@
  *
  */
 
-#include "e-alert-bar.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "e-dialog-widgets.h"
+#include "e-alert-bar.h"
 
 #define E_ALERT_BAR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index d972c2b..d239257 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -20,9 +20,7 @@
  * Copyright (C) 2009 Intel Corporation
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/e-util/e-alert-sink.c b/e-util/e-alert-sink.c
index e70f57d..9a826fa 100644
--- a/e-util/e-alert-sink.c
+++ b/e-util/e-alert-sink.c
@@ -24,9 +24,7 @@
  * usually by displaying them to the user.
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <camel/camel.h>
diff --git a/e-util/e-alert.c b/e-util/e-alert.c
index f83f87c..c8823b8 100644
--- a/e-util/e-alert.c
+++ b/e-util/e-alert.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <sys/types.h>
diff --git a/e-util/e-attachment-bar.c b/e-util/e-attachment-bar.c
index e5da99f..fbe0add 100644
--- a/e-util/e-attachment-bar.c
+++ b/e-util/e-attachment-bar.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-bar.h"
 
diff --git a/e-util/e-attachment-dialog.c b/e-util/e-attachment-dialog.c
index 0f71bc9..e34e8d2 100644
--- a/e-util/e-attachment-dialog.c
+++ b/e-util/e-attachment-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-dialog.h"
 
diff --git a/e-util/e-attachment-handler-image.c b/e-util/e-attachment-handler-image.c
index 5de55e9..4edb9c5 100644
--- a/e-util/e-attachment-handler-image.c
+++ b/e-util/e-attachment-handler-image.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-handler-image.h"
 
diff --git a/e-util/e-attachment-handler.c b/e-util/e-attachment-handler.c
index 7898a60..c81a616 100644
--- a/e-util/e-attachment-handler.c
+++ b/e-util/e-attachment-handler.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-handler.h"
 
diff --git a/e-util/e-attachment-icon-view.c b/e-util/e-attachment-icon-view.c
index cd0bc52..1f33644 100644
--- a/e-util/e-attachment-icon-view.c
+++ b/e-util/e-attachment-icon-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-icon-view.h"
 
diff --git a/e-util/e-attachment-paned.c b/e-util/e-attachment-paned.c
index ee96a9a..71242ab 100644
--- a/e-util/e-attachment-paned.c
+++ b/e-util/e-attachment-paned.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-paned.h"
 
diff --git a/e-util/e-attachment-store.c b/e-util/e-attachment-store.c
index 05e4809..e1191fc 100644
--- a/e-util/e-attachment-store.c
+++ b/e-util/e-attachment-store.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-store.h"
 #include "e-icon-factory.h"
diff --git a/e-util/e-attachment-tree-view.c b/e-util/e-attachment-tree-view.c
index 9f20a7d..8d19eb5 100644
--- a/e-util/e-attachment-tree-view.c
+++ b/e-util/e-attachment-tree-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-tree-view.h"
 
diff --git a/e-util/e-attachment-view.c b/e-util/e-attachment-view.c
index 00b17df..b713a5b 100644
--- a/e-util/e-attachment-view.c
+++ b/e-util/e-attachment-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment-view.h"
 
diff --git a/e-util/e-attachment.c b/e-util/e-attachment.c
index 21dec66..2c3ec5b 100644
--- a/e-util/e-attachment.c
+++ b/e-util/e-attachment.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-attachment.h"
 
diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c
index 8e70095..0f87e43 100644
--- a/e-util/e-bit-array.c
+++ b/e-util/e-bit-array.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-book-source-config.c b/e-util/e-book-source-config.c
index a4f8ea1..4899fc6 100644
--- a/e-util/e-book-source-config.c
+++ b/e-util/e-book-source-config.c
@@ -15,9 +15,10 @@
  *
  */
 
+#include "evolution-config.h"
+
 #include "e-book-source-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #define E_BOOK_SOURCE_CONFIG_GET_PRIVATE(obj) \
diff --git a/e-util/e-buffer-tagger.c b/e-util/e-buffer-tagger.c
index 91c9ea8..77d82f4 100644
--- a/e-util/e-buffer-tagger.c
+++ b/e-util/e-buffer-tagger.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff --git a/e-util/e-cal-source-config.c b/e-util/e-cal-source-config.c
index d90d93f..833f580 100644
--- a/e-util/e-cal-source-config.c
+++ b/e-util/e-cal-source-config.c
@@ -15,12 +15,12 @@
  *
  */
 
-#include "e-cal-source-config.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "e-misc-utils.h"
+#include "e-cal-source-config.h"
 
 #define E_CAL_SOURCE_CONFIG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-calendar-item.c b/e-util/e-calendar-item.c
index e63a714..fc6d8af 100644
--- a/e-util/e-calendar-item.c
+++ b/e-util/e-calendar-item.c
@@ -20,9 +20,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libebackend/libebackend.h>
 
diff --git a/e-util/e-calendar.c b/e-util/e-calendar.c
index f429ec0..706278c 100644
--- a/e-util/e-calendar.c
+++ b/e-util/e-calendar.c
@@ -28,9 +28,8 @@
  * to got to the current day.
  */
 
-#include "e-calendar.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n.h>
 
 #include <gtk/gtk.h>
@@ -39,6 +38,7 @@
 #include <libgnomecanvas/gnome-canvas-widget.h>
 
 #include "e-misc-utils.h"
+#include "e-calendar.h"
 
 #define E_CALENDAR_SMALL_FONT_PTSIZE 6
 
diff --git a/e-util/e-canvas-background.c b/e-util/e-canvas-background.c
index b7612ca..36af28a 100644
--- a/e-util/e-canvas-background.c
+++ b/e-util/e-canvas-background.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-canvas-background.h"
 
diff --git a/e-util/e-canvas-utils.c b/e-util/e-canvas-utils.c
index fa753c5..79c2090 100644
--- a/e-util/e-canvas-utils.c
+++ b/e-util/e-canvas-utils.c
@@ -20,11 +20,10 @@
  *
  */
 
-#include "e-canvas-utils.h"
-
-#include <config.h>
+#include "evolution-config.h"
 
 #include <libedataserver/libedataserver.h>
+#include "e-canvas-utils.h"
 
 void
 e_canvas_item_move_absolute (GnomeCanvasItem *item,
diff --git a/e-util/e-canvas-vbox.c b/e-util/e-canvas-vbox.c
index a7bcbc9..656a6ee 100644
--- a/e-util/e-canvas-vbox.c
+++ b/e-util/e-canvas-vbox.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 
diff --git a/e-util/e-canvas.c b/e-util/e-canvas.c
index f9f6b14..7929a17 100644
--- a/e-util/e-canvas.c
+++ b/e-util/e-canvas.c
@@ -19,13 +19,13 @@
  *
  */
 
-#include "e-canvas.h"
-
-#include <config.h>
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libedataserver/libedataserver.h>
 
+#include "e-canvas.h"
+
 #define d(x)
 
 enum {
diff --git a/e-util/e-categories-config.c b/e-util/e-categories-config.c
index 226f653..6816c5c 100644
--- a/e-util/e-categories-config.c
+++ b/e-util/e-categories-config.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-categories-config.h"
 
diff --git a/e-util/e-categories-dialog.c b/e-util/e-categories-dialog.c
index dcd2d58..d7eea4b 100644
--- a/e-util/e-categories-dialog.c
+++ b/e-util/e-categories-dialog.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-categories-editor.c b/e-util/e-categories-editor.c
index eed1043..f6e411f 100644
--- a/e-util/e-categories-editor.c
+++ b/e-util/e-categories-editor.c
@@ -15,7 +15,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <string.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
diff --git a/e-util/e-categories-selector.c b/e-util/e-categories-selector.c
index e014e7d..c148dc5 100644
--- a/e-util/e-categories-selector.c
+++ b/e-util/e-categories-selector.c
@@ -15,7 +15,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libedataserver/libedataserver.h>
diff --git a/e-util/e-category-completion.c b/e-util/e-category-completion.c
index 8210f72..a45447b 100644
--- a/e-util/e-category-completion.c
+++ b/e-util/e-category-completion.c
@@ -14,11 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#include "e-category-completion.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
@@ -26,6 +22,7 @@
 #include <libedataserver/libedataserver.h>
 
 #include "e-misc-utils.h"
+#include "e-category-completion.h"
 
 #define E_CATEGORY_COMPLETION_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-category-editor.c b/e-util/e-category-editor.c
index 708ba5c..9c01438 100644
--- a/e-util/e-category-editor.c
+++ b/e-util/e-category-editor.c
@@ -14,9 +14,8 @@
  * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-cell-checkbox.c b/e-util/e-cell-checkbox.c
index 88f898c..c56cc50 100644
--- a/e-util/e-cell-checkbox.c
+++ b/e-util/e-cell-checkbox.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-cell-combo.c b/e-util/e-cell-combo.c
index 966f97a..de2fde8 100644
--- a/e-util/e-cell-combo.c
+++ b/e-util/e-cell-combo.c
@@ -52,9 +52,7 @@
  *   close the popup, like the Escape key, or a button press outside the popup.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cell-combo.h"
 
diff --git a/e-util/e-cell-date-edit.c b/e-util/e-cell-date-edit.c
index a1abd55..1226e1d 100644
--- a/e-util/e-cell-date-edit.c
+++ b/e-util/e-cell-date-edit.c
@@ -24,9 +24,7 @@
  * window to edit it.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cell-date-edit.h"
 
diff --git a/e-util/e-cell-date-int.c b/e-util/e-cell-date-int.c
index 6f0dd75..4ce6cd9 100644
--- a/e-util/e-cell-date-int.c
+++ b/e-util/e-cell-date-int.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cell-date.h"
 #include "e-cell-date-int.h"
diff --git a/e-util/e-cell-date.c b/e-util/e-cell-date.c
index 7f0da8e..1ac86a9 100644
--- a/e-util/e-cell-date.c
+++ b/e-util/e-cell-date.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cell-date.h"
 
diff --git a/e-util/e-cell-hbox.c b/e-util/e-cell-hbox.c
index 74a7871..7717949 100644
--- a/e-util/e-cell-hbox.c
+++ b/e-util/e-cell-hbox.c
@@ -23,9 +23,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <math.h>
diff --git a/e-util/e-cell-number.c b/e-util/e-cell-number.c
index c59c4b9..e35fef8 100644
--- a/e-util/e-cell-number.c
+++ b/e-util/e-cell-number.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cell-number.h"
 
diff --git a/e-util/e-cell-percent.c b/e-util/e-cell-percent.c
index 981f252..5086aca 100644
--- a/e-util/e-cell-percent.c
+++ b/e-util/e-cell-percent.c
@@ -24,9 +24,7 @@
  * in an ETable.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 
diff --git a/e-util/e-cell-pixbuf.c b/e-util/e-cell-pixbuf.c
index 466c354..16b91a2 100644
--- a/e-util/e-cell-pixbuf.c
+++ b/e-util/e-cell-pixbuf.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 
diff --git a/e-util/e-cell-popup.c b/e-util/e-cell-popup.c
index ee7fc54..0011451 100644
--- a/e-util/e-cell-popup.c
+++ b/e-util/e-cell-popup.c
@@ -28,9 +28,7 @@
  * popup.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gdk/gdkkeysyms.h>
 
diff --git a/e-util/e-cell-size.c b/e-util/e-cell-size.c
index 662443e..8a8341b 100644
--- a/e-util/e-cell-size.c
+++ b/e-util/e-cell-size.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/time.h>
 #include <unistd.h>
diff --git a/e-util/e-cell-text.c b/e-util/e-cell-text.c
index 3e39fad..64aa840 100644
--- a/e-util/e-cell-text.c
+++ b/e-util/e-cell-text.c
@@ -32,9 +32,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <ctype.h>
diff --git a/e-util/e-cell-toggle.c b/e-util/e-cell-toggle.c
index b081bac..3503f64 100644
--- a/e-util/e-cell-toggle.c
+++ b/e-util/e-cell-toggle.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-cell-tree.c b/e-util/e-cell-tree.c
index 3f83ef6..2e9cf7d 100644
--- a/e-util/e-cell-tree.c
+++ b/e-util/e-cell-tree.c
@@ -27,9 +27,7 @@
  * 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <math.h>
diff --git a/e-util/e-cell-vbox.c b/e-util/e-cell-vbox.c
index 49265e3..7d9ab07 100644
--- a/e-util/e-cell-vbox.c
+++ b/e-util/e-cell-vbox.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <math.h>
diff --git a/e-util/e-cell.c b/e-util/e-cell.c
index d66276e..c35f853 100644
--- a/e-util/e-cell.c
+++ b/e-util/e-cell.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-charset-combo-box.c b/e-util/e-charset-combo-box.c
index 0036cf4..1f15727 100644
--- a/e-util/e-charset-combo-box.c
+++ b/e-util/e-charset-combo-box.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-charset-combo-box.h"
 
diff --git a/e-util/e-charset.c b/e-util/e-charset.c
index de4e998..2cc7188 100644
--- a/e-util/e-charset.c
+++ b/e-util/e-charset.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-charset.h"
 
diff --git a/e-util/e-client-cache.c b/e-util/e-client-cache.c
index 2c084c3..07da3df 100644
--- a/e-util/e-client-cache.c
+++ b/e-util/e-client-cache.c
@@ -30,15 +30,16 @@
  * and a new instance is created on the next request.
  **/
 
-#include "e-client-cache.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libecal/libecal.h>
 #include <libebook/libebook.h>
 #include <libebackend/libebackend.h>
 
+#include "e-client-cache.h"
+
 #define E_CLIENT_CACHE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_CLIENT_CACHE, EClientCachePrivate))
diff --git a/e-util/e-client-selector.c b/e-util/e-client-selector.c
index 42769d5..473e147 100644
--- a/e-util/e-client-selector.c
+++ b/e-util/e-client-selector.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 /**
  * SECTION: e-client-selector
diff --git a/e-util/e-color-chooser-widget.c b/e-util/e-color-chooser-widget.c
index 530f199..f7d5bbb 100644
--- a/e-util/e-color-chooser-widget.c
+++ b/e-util/e-color-chooser-widget.c
@@ -18,9 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-color-chooser-widget.h"
 
diff --git a/e-util/e-color-combo.c b/e-util/e-color-combo.c
index 3a9c051..53975be 100644
--- a/e-util/e-color-combo.c
+++ b/e-util/e-color-combo.c
@@ -17,9 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-color-combo.h"
 #include "e-color-chooser-widget.h"
diff --git a/e-util/e-config.c b/e-util/e-config.c
index 709f7c9..0b9c7f5 100644
--- a/e-util/e-config.c
+++ b/e-util/e-config.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/e-util/e-contact-store.c b/e-util/e-contact-store.c
index 05c0bde..f81ffca 100644
--- a/e-util/e-contact-store.c
+++ b/e-util/e-contact-store.c
@@ -19,9 +19,7 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-content-editor.c b/e-util/e-content-editor.c
index 2224af0..18baf87 100644
--- a/e-util/e-content-editor.c
+++ b/e-util/e-content-editor.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib-object.h>
diff --git a/e-util/e-content-request.c b/e-util/e-content-request.c
index 9448d44..3e95094 100644
--- a/e-util/e-content-request.c
+++ b/e-util/e-content-request.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 
diff --git a/e-util/e-dateedit.c b/e-util/e-dateedit.c
index 6b08132..8af28c5 100644
--- a/e-util/e-dateedit.c
+++ b/e-util/e-dateedit.c
@@ -22,9 +22,7 @@
  * time field with popups for entering a date.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-dateedit.h"
 
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index bb4918a..fd3def6 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -17,9 +17,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-destination-store.c b/e-util/e-destination-store.c
index c61b42f..4dcb08b 100644
--- a/e-util/e-destination-store.c
+++ b/e-util/e-destination-store.c
@@ -19,9 +19,7 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-dialog-utils.c b/e-util/e-dialog-utils.c
index bf7e66b..f380ca3 100644
--- a/e-util/e-dialog-utils.c
+++ b/e-util/e-dialog-utils.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-dialog-utils.h"
 
diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c
index 1386002..a2618a5 100644
--- a/e-util/e-dialog-widgets.c
+++ b/e-util/e-dialog-widgets.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <string.h>
diff --git a/e-util/e-emoticon-chooser-menu.c b/e-util/e-emoticon-chooser-menu.c
index f2ed337..d4b6f79 100644
--- a/e-util/e-emoticon-chooser-menu.c
+++ b/e-util/e-emoticon-chooser-menu.c
@@ -19,9 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-emoticon-chooser-menu.h"
 #include "e-emoticon-chooser.h"
diff --git a/e-util/e-emoticon-chooser.c b/e-util/e-emoticon-chooser.c
index 428e116..f58d1f3 100644
--- a/e-util/e-emoticon-chooser.c
+++ b/e-util/e-emoticon-chooser.c
@@ -19,9 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-emoticon-chooser.h"
 
diff --git a/e-util/e-emoticon-tool-button.c b/e-util/e-emoticon-tool-button.c
index 0b10133..bf274d3 100644
--- a/e-util/e-emoticon-tool-button.c
+++ b/e-util/e-emoticon-tool-button.c
@@ -19,9 +19,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-emoticon-tool-button.h"
 
diff --git a/e-util/e-event.c b/e-util/e-event.c
index 34a00be..5860526 100644
--- a/e-util/e-event.c
+++ b/e-util/e-event.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/e-util/e-file-request.c b/e-util/e-file-request.c
index 8cdb18a..f58c809 100644
--- a/e-util/e-file-request.c
+++ b/e-util/e-file-request.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/e-util/e-file-utils.c b/e-util/e-file-utils.c
index be1e912..7577404 100644
--- a/e-util/e-file-utils.c
+++ b/e-util/e-file-utils.c
@@ -20,11 +20,12 @@
  *
  */
 
-#include "e-file-utils.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-file-utils.h"
+
 typedef struct _AsyncContext AsyncContext;
 
 struct _AsyncContext {
diff --git a/e-util/e-filter-code.c b/e-util/e-filter-code.c
index a4fc5a0..5fd6779 100644
--- a/e-util/e-filter-code.c
+++ b/e-util/e-filter-code.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-filter-code.h"
 #include "e-filter-part.h"
diff --git a/e-util/e-filter-color.c b/e-util/e-filter-color.c
index a833f16..24f8e3c 100644
--- a/e-util/e-filter-color.c
+++ b/e-util/e-filter-color.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-filter-datespec.c b/e-util/e-filter-datespec.c
index 71a3972..a975dca 100644
--- a/e-util/e-filter-datespec.c
+++ b/e-util/e-filter-datespec.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/e-util/e-filter-element.c b/e-util/e-filter-element.c
index 2fbcb17..f97f482 100644
--- a/e-util/e-filter-element.c
+++ b/e-util/e-filter-element.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/e-util/e-filter-file.c b/e-util/e-filter-file.c
index 52cf538..9cdc2b0 100644
--- a/e-util/e-filter-file.c
+++ b/e-util/e-filter-file.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <sys/types.h>
diff --git a/e-util/e-filter-input.c b/e-util/e-filter-input.c
index dac0d5b..9dbc856 100644
--- a/e-util/e-filter-input.c
+++ b/e-util/e-filter-input.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <sys/types.h>
diff --git a/e-util/e-filter-int.c b/e-util/e-filter-int.c
index 24f18cf..9127079 100644
--- a/e-util/e-filter-int.c
+++ b/e-util/e-filter-int.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-filter-option.c b/e-util/e-filter-option.c
index cec156b..cd4ca4e 100644
--- a/e-util/e-filter-option.c
+++ b/e-util/e-filter-option.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-filter-part.c b/e-util/e-filter-part.c
index b36a81e..99206d8 100644
--- a/e-util/e-filter-part.c
+++ b/e-util/e-filter-part.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-filter-rule.c b/e-util/e-filter-rule.c
index ef3e688..4b5d7ae 100644
--- a/e-util/e-filter-rule.c
+++ b/e-util/e-filter-rule.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-focus-tracker.c b/e-util/e-focus-tracker.c
index 794e56d..c4390e3 100644
--- a/e-util/e-focus-tracker.c
+++ b/e-util/e-focus-tracker.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-focus-tracker.h"
 
diff --git a/e-util/e-html-editor-actions.c b/e-util/e-html-editor-actions.c
index 3e2780a..14e76aa 100644
--- a/e-util/e-html-editor-actions.c
+++ b/e-util/e-html-editor-actions.c
@@ -17,9 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gio/gio.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-html-editor-cell-dialog.c b/e-util/e-html-editor-cell-dialog.c
index b5379ec..b06f6b2 100644
--- a/e-util/e-html-editor-cell-dialog.c
+++ b/e-util/e-html-editor-cell-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-cell-dialog.h"
 
diff --git a/e-util/e-html-editor-dialog.c b/e-util/e-html-editor-dialog.c
index b62e4ac..1ee2330 100644
--- a/e-util/e-html-editor-dialog.c
+++ b/e-util/e-html-editor-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-html-editor-find-dialog.c b/e-util/e-html-editor-find-dialog.c
index f1ad2f2..b8a3d97 100644
--- a/e-util/e-html-editor-find-dialog.c
+++ b/e-util/e-html-editor-find-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-find-dialog.h"
 #include "e-dialog-widgets.h"
diff --git a/e-util/e-html-editor-hrule-dialog.c b/e-util/e-html-editor-hrule-dialog.c
index 5dc6860..342cdc1 100644
--- a/e-util/e-html-editor-hrule-dialog.c
+++ b/e-util/e-html-editor-hrule-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-hrule-dialog.h"
 
diff --git a/e-util/e-html-editor-image-dialog.c b/e-util/e-html-editor-image-dialog.c
index 71d4779..975ebf9 100644
--- a/e-util/e-html-editor-image-dialog.c
+++ b/e-util/e-html-editor-image-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-html-editor-link-dialog.c b/e-util/e-html-editor-link-dialog.c
index 84f4590..bc348df 100644
--- a/e-util/e-html-editor-link-dialog.c
+++ b/e-util/e-html-editor-link-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-html-editor-page-dialog.c b/e-util/e-html-editor-page-dialog.c
index 2399566..e86f2c9 100644
--- a/e-util/e-html-editor-page-dialog.c
+++ b/e-util/e-html-editor-page-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-page-dialog.h"
 
diff --git a/e-util/e-html-editor-paragraph-dialog.c b/e-util/e-html-editor-paragraph-dialog.c
index 654bde5..014de3b 100644
--- a/e-util/e-html-editor-paragraph-dialog.c
+++ b/e-util/e-html-editor-paragraph-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-paragraph-dialog.h"
 
diff --git a/e-util/e-html-editor-private.h b/e-util/e-html-editor-private.h
index 37523a5..3084db6 100644
--- a/e-util/e-html-editor-private.h
+++ b/e-util/e-html-editor-private.h
@@ -21,21 +21,21 @@
 #ifndef E_HTML_EDITOR_PRIVATE_H
 #define E_HTML_EDITOR_PRIVATE_H
 
-#include <e-action-combo-box.h>
-#include <e-color-combo.h>
-#include <e-html-editor.h>
-#include <e-html-editor-actions.h>
-#include <e-html-editor-cell-dialog.h>
-#include <e-html-editor-find-dialog.h>
-#include <e-html-editor-hrule-dialog.h>
-#include <e-html-editor-image-dialog.h>
-#include <e-html-editor-link-dialog.h>
-#include <e-html-editor-page-dialog.h>
-#include <e-html-editor-paragraph-dialog.h>
-#include <e-html-editor-replace-dialog.h>
-#include <e-html-editor-spell-check-dialog.h>
-#include <e-html-editor-table-dialog.h>
-#include <e-html-editor-text-dialog.h>
+#include <e-util/e-action-combo-box.h>
+#include <e-util/e-color-combo.h>
+#include <e-util/e-html-editor.h>
+#include <e-util/e-html-editor-actions.h>
+#include <e-util/e-html-editor-cell-dialog.h>
+#include <e-util/e-html-editor-find-dialog.h>
+#include <e-util/e-html-editor-hrule-dialog.h>
+#include <e-util/e-html-editor-image-dialog.h>
+#include <e-util/e-html-editor-link-dialog.h>
+#include <e-util/e-html-editor-page-dialog.h>
+#include <e-util/e-html-editor-paragraph-dialog.h>
+#include <e-util/e-html-editor-replace-dialog.h>
+#include <e-util/e-html-editor-spell-check-dialog.h>
+#include <e-util/e-html-editor-table-dialog.h>
+#include <e-util/e-html-editor-text-dialog.h>
 
 #ifdef HAVE_XFREE
 #include <X11/XF86keysym.h>
diff --git a/e-util/e-html-editor-replace-dialog.c b/e-util/e-html-editor-replace-dialog.c
index 59b69a7..d217b75 100644
--- a/e-util/e-html-editor-replace-dialog.c
+++ b/e-util/e-html-editor-replace-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-replace-dialog.h"
 
diff --git a/e-util/e-html-editor-spell-check-dialog.c b/e-util/e-html-editor-spell-check-dialog.c
index d7447e0..72056f0 100644
--- a/e-util/e-html-editor-spell-check-dialog.c
+++ b/e-util/e-html-editor-spell-check-dialog.c
@@ -18,9 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-spell-check-dialog.h"
 
diff --git a/e-util/e-html-editor-table-dialog.c b/e-util/e-html-editor-table-dialog.c
index 370b72f..484975b 100644
--- a/e-util/e-html-editor-table-dialog.c
+++ b/e-util/e-html-editor-table-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-table-dialog.h"
 
diff --git a/e-util/e-html-editor-text-dialog.c b/e-util/e-html-editor-text-dialog.c
index f944338..7d1ce72 100644
--- a/e-util/e-html-editor-text-dialog.c
+++ b/e-util/e-html-editor-text-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-html-editor-text-dialog.h"
 
diff --git a/e-util/e-html-editor.c b/e-util/e-html-editor.c
index 39070ee..ff14693 100644
--- a/e-util/e-html-editor.c
+++ b/e-util/e-html-editor.c
@@ -18,7 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c
index 9187b75..73f508b 100644
--- a/e-util/e-html-utils.c
+++ b/e-util/e-html-utils.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <stdio.h>
diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c
index 9263ee4..fc43b4b 100644
--- a/e-util/e-icon-factory.c
+++ b/e-util/e-icon-factory.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/e-util/e-image-chooser-dialog.c b/e-util/e-image-chooser-dialog.c
index da788f5..56d8f7d 100644
--- a/e-util/e-image-chooser-dialog.c
+++ b/e-util/e-image-chooser-dialog.c
@@ -18,9 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-image-chooser.c b/e-util/e-image-chooser.c
index 92c4365..cf42c21 100644
--- a/e-util/e-image-chooser.c
+++ b/e-util/e-image-chooser.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/e-util/e-import-assistant.c b/e-util/e-import-assistant.c
index d028312..c8d2e5d 100644
--- a/e-util/e-import-assistant.c
+++ b/e-util/e-import-assistant.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-import-assistant.h"
 
diff --git a/e-util/e-import.c b/e-util/e-import.c
index b35319c..acbc4ea 100644
--- a/e-util/e-import.c
+++ b/e-util/e-import.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #ifdef HAVE_IMPORT_H
 #include <import.h>
diff --git a/e-util/e-interval-chooser.c b/e-util/e-interval-chooser.c
index df6805c..57207b9 100644
--- a/e-util/e-interval-chooser.c
+++ b/e-util/e-interval-chooser.c
@@ -15,14 +15,15 @@
  *
  */
 
-#include "e-interval-chooser.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "e-util-enums.h"
 #include "e-misc-utils.h"
 
+#include "e-interval-chooser.h"
+
 #define E_INTERVAL_CHOOSER_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_INTERVAL_CHOOSER, EIntervalChooserPrivate))
diff --git a/e-util/e-mail-identity-combo-box.c b/e-util/e-mail-identity-combo-box.c
index 9320d13..4f8d8b1 100644
--- a/e-util/e-mail-identity-combo-box.c
+++ b/e-util/e-mail-identity-combo-box.c
@@ -26,11 +26,12 @@
  * with #ESource #ESource:uid strings.
  **/
 
-#include "e-mail-identity-combo-box.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-identity-combo-box.h"
+
 #define E_MAIL_IDENTITY_COMBO_BOX_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_IDENTITY_COMBO_BOX, EMailIdentityComboBoxPrivate))
diff --git a/e-util/e-mail-signature-combo-box.c b/e-util/e-mail-signature-combo-box.c
index fda55a4..92949b8 100644
--- a/e-util/e-mail-signature-combo-box.c
+++ b/e-util/e-mail-signature-combo-box.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-signature-combo-box.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-signature-combo-box.h"
+
 #define E_MAIL_SIGNATURE_COMBO_BOX_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_SIGNATURE_COMBO_BOX, EMailSignatureComboBoxPrivate))
diff --git a/e-util/e-mail-signature-editor.c b/e-util/e-mail-signature-editor.c
index 45c5f7a..e888111 100644
--- a/e-util/e-mail-signature-editor.c
+++ b/e-util/e-mail-signature-editor.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-signature-editor.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n.h>
 
@@ -26,6 +25,8 @@
 #include "e-alert-bar.h"
 #include "e-simple-async-result.h"
 
+#include "e-mail-signature-editor.h"
+
 #define E_MAIL_SIGNATURE_EDITOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_SIGNATURE_EDITOR, EMailSignatureEditorPrivate))
diff --git a/e-util/e-mail-signature-script-dialog.c b/e-util/e-mail-signature-script-dialog.c
index 72040f9..d7cbf1e 100644
--- a/e-util/e-mail-signature-script-dialog.c
+++ b/e-util/e-mail-signature-script-dialog.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-signature-script-dialog.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-signature-script-dialog.h"
+
 #define E_MAIL_SIGNATURE_SCRIPT_DIALOG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_SIGNATURE_SCRIPT_DIALOG, \
diff --git a/e-util/e-map.c b/e-util/e-map.c
index 1b3d51a..61419d1 100644
--- a/e-util/e-map.c
+++ b/e-util/e-map.c
@@ -21,9 +21,8 @@
  *
  */
 
-#include "e-map.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <math.h>
 #include <stdlib.h>
 
@@ -34,6 +33,8 @@
 
 #include "e-util-private.h"
 
+#include "e-map.h"
+
 #define E_MAP_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAP, EMapPrivate))
diff --git a/e-util/e-menu-tool-action.c b/e-util/e-menu-tool-action.c
index bc4e9b2..97e5276 100644
--- a/e-util/e-menu-tool-action.c
+++ b/e-util/e-menu-tool-action.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-menu-tool-action.h"
 
diff --git a/e-util/e-menu-tool-button.c b/e-util/e-menu-tool-button.c
index cffadd0..0ee2181 100644
--- a/e-util/e-menu-tool-button.c
+++ b/e-util/e-menu-tool-button.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-menu-tool-button.h"
 #include "e-misc-utils.h"
diff --git a/e-util/e-misc-utils.c b/e-util/e-misc-utils.c
index 13ce806..4821680 100644
--- a/e-util/e-misc-utils.c
+++ b/e-util/e-misc-utils.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-misc-utils.h"
 
diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c
index 3112140..ca321ce 100644
--- a/e-util/e-mktemp.c
+++ b/e-util/e-mktemp.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gstdio.h>
 #include <sys/stat.h>
diff --git a/e-util/e-name-selector-dialog.c b/e-util/e-name-selector-dialog.c
index d776190..f2db4d7 100644
--- a/e-util/e-name-selector-dialog.c
+++ b/e-util/e-name-selector-dialog.c
@@ -19,11 +19,8 @@
  * Author: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef GTK_DISABLE_DEPRECATED
-#undef GTK_DISABLE_DEPRECATED
-#endif
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-name-selector-entry.c b/e-util/e-name-selector-entry.c
index 94b92a5..03dd8f0 100644
--- a/e-util/e-name-selector-entry.c
+++ b/e-util/e-name-selector-entry.c
@@ -19,7 +19,8 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-name-selector-list.c b/e-util/e-name-selector-list.c
index 2de7e7f..548c6d3 100644
--- a/e-util/e-name-selector-list.c
+++ b/e-util/e-name-selector-list.c
@@ -22,7 +22,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <string.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-name-selector-model.c b/e-util/e-name-selector-model.c
index 3e5116b..5443b66 100644
--- a/e-util/e-name-selector-model.c
+++ b/e-util/e-name-selector-model.c
@@ -19,9 +19,7 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-name-selector.c b/e-util/e-name-selector.c
index e5f8993..054ee56 100644
--- a/e-util/e-name-selector.c
+++ b/e-util/e-name-selector.c
@@ -19,9 +19,7 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/e-util/e-online-button.c b/e-util/e-online-button.c
index b2bd687..36fc5a4 100644
--- a/e-util/e-online-button.c
+++ b/e-util/e-online-button.c
@@ -14,9 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-online-button.h"
 
diff --git a/e-util/e-paned.c b/e-util/e-paned.c
index b4a0914..300293a 100644
--- a/e-util/e-paned.c
+++ b/e-util/e-paned.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-paned.h"
 
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c
index 2505e4a..2247c47 100644
--- a/e-util/e-passwords.c
+++ b/e-util/e-passwords.c
@@ -35,9 +35,7 @@
  * order, but will not be processed out of order.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "evolution-config.h"
 
 #include <limits.h>
 #include <stdlib.h>
diff --git a/e-util/e-picture-gallery.c b/e-util/e-picture-gallery.c
index 6e01715..217ac5b 100644
--- a/e-util/e-picture-gallery.c
+++ b/e-util/e-picture-gallery.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-picture-gallery.h"
 
diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c
index e875b5a..e81113e 100644
--- a/e-util/e-plugin-ui.c
+++ b/e-util/e-plugin-ui.c
@@ -14,9 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-plugin-ui.h"
 
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index 5657b75..4926cfa 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -15,9 +15,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <string.h>
diff --git a/e-util/e-poolv.c b/e-util/e-poolv.c
index 1207d08..02f1efa 100644
--- a/e-util/e-poolv.c
+++ b/e-util/e-poolv.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-poolv.h"
 
diff --git a/e-util/e-popup-action.c b/e-util/e-popup-action.c
index 9a3702b..9eb9835 100644
--- a/e-util/e-popup-action.c
+++ b/e-util/e-popup-action.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-popup-action.h"
 
diff --git a/e-util/e-popup-menu.c b/e-util/e-popup-menu.c
index fc2ec02..c49d19f 100644
--- a/e-util/e-popup-menu.c
+++ b/e-util/e-popup-menu.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libintl.h>
 #include <string.h>
diff --git a/e-util/e-port-entry.c b/e-util/e-port-entry.c
index e0925d0..182f6c8 100644
--- a/e-util/e-port-entry.c
+++ b/e-util/e-port-entry.c
@@ -11,13 +11,14 @@
  *     Dan Vratil <dvratil redhat com>
  */
 
-#include "e-port-entry.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <errno.h>
 #include <stddef.h>
 #include <string.h>
 
+#include "e-port-entry.h"
+
 #define E_PORT_ENTRY_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_PORT_ENTRY, EPortEntryPrivate))
diff --git a/e-util/e-preferences-window.c b/e-util/e-preferences-window.c
index 680140d..1bebeb6 100644
--- a/e-util/e-preferences-window.c
+++ b/e-util/e-preferences-window.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-preferences-window.h"
 
diff --git a/e-util/e-print.c b/e-util/e-print.c
index f2a6688..0a2ab1c 100644
--- a/e-util/e-print.c
+++ b/e-util/e-print.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-print.h"
 
diff --git a/e-util/e-printable.c b/e-util/e-printable.c
index 9d2b42c..325e994 100644
--- a/e-util/e-printable.c
+++ b/e-util/e-printable.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-proxy-editor.c b/e-util/e-proxy-editor.c
index c8e69ba..db8a822 100644
--- a/e-util/e-proxy-editor.c
+++ b/e-util/e-proxy-editor.c
@@ -28,11 +28,12 @@
  * e_proxy_editor_set_source().
  **/
 
-#include "e-proxy-editor.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-proxy-editor.h"
+
 #define E_PROXY_EDITOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_PROXY_EDITOR, EProxyEditorPrivate))
diff --git a/e-util/e-proxy-preferences.c b/e-util/e-proxy-preferences.c
index 1dd259f..d93d397 100644
--- a/e-util/e-proxy-preferences.c
+++ b/e-util/e-proxy-preferences.c
@@ -29,14 +29,15 @@
  * accounts.
  **/
 
-#include "e-proxy-preferences.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
-#include <e-util/e-proxy-editor.h>
-#include <e-util/e-proxy-link-selector.h>
-#include <e-util/e-proxy-selector.h>
+#include "e-proxy-editor.h"
+#include "e-proxy-link-selector.h"
+#include "e-proxy-selector.h"
+
+#include "e-proxy-preferences.h"
 
 #define E_PROXY_PREFERENCES_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-proxy-selector.c b/e-util/e-proxy-selector.c
index e66185b..2017aa7 100644
--- a/e-util/e-proxy-selector.c
+++ b/e-util/e-proxy-selector.c
@@ -24,11 +24,12 @@
  * toolbar controls for adding and removing profiles.
  **/
 
-#include "e-proxy-selector.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-proxy-selector.h"
+
 #define E_PROXY_SELECTOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_PROXY_SELECTOR, EProxySelectorPrivate))
diff --git a/e-util/e-reflow-model.c b/e-util/e-reflow-model.c
index 6af3c46..bce9e40 100644
--- a/e-util/e-reflow-model.c
+++ b/e-util/e-reflow-model.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-reflow-model.h"
 
diff --git a/e-util/e-reflow.c b/e-util/e-reflow.c
index 3f3d22f..6ce2e7a 100644
--- a/e-util/e-reflow.c
+++ b/e-util/e-reflow.c
@@ -19,9 +19,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-reflow.h"
 
diff --git a/e-util/e-rule-context.c b/e-util/e-rule-context.c
index 668bea2..8fe5b27 100644
--- a/e-util/e-rule-context.c
+++ b/e-util/e-rule-context.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <sys/types.h>
diff --git a/e-util/e-rule-editor.c b/e-util/e-rule-editor.c
index 7fe08f3..2120fc1 100644
--- a/e-util/e-rule-editor.c
+++ b/e-util/e-rule-editor.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-rule-editor.h"
 
diff --git a/e-util/e-search-bar.c b/e-util/e-search-bar.c
index b5ebdde..2b5a860 100644
--- a/e-util/e-search-bar.c
+++ b/e-util/e-search-bar.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-search-bar.h"
 
diff --git a/e-util/e-selectable.c b/e-util/e-selectable.c
index 5e3267c..95684e7 100644
--- a/e-util/e-selectable.c
+++ b/e-util/e-selectable.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-selectable.h"
 
diff --git a/e-util/e-selection-model-array.c b/e-util/e-selection-model-array.c
index 05b570d..c0735f1 100644
--- a/e-util/e-selection-model-array.c
+++ b/e-util/e-selection-model-array.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-selection-model-simple.c b/e-util/e-selection-model-simple.c
index 0669117..ae27f1f 100644
--- a/e-util/e-selection-model-simple.c
+++ b/e-util/e-selection-model-simple.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-selection-model-array.h"
 #include "e-selection-model-simple.h"
diff --git a/e-util/e-selection-model.c b/e-util/e-selection-model.c
index 45c4289..99e8d29 100644
--- a/e-util/e-selection-model.c
+++ b/e-util/e-selection-model.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-selection-model.h"
 
diff --git a/e-util/e-selection.c b/e-util/e-selection.c
index c789c73..8818bfd 100644
--- a/e-util/e-selection.c
+++ b/e-util/e-selection.c
@@ -24,9 +24,7 @@
  * @include: e-util/e-util.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-selection.h"
 
diff --git a/e-util/e-send-options.c b/e-util/e-send-options.c
index b95486a..580c087 100644
--- a/e-util/e-send-options.c
+++ b/e-util/e-send-options.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-send-options.h"
 
diff --git a/e-util/e-simple-async-result.c b/e-util/e-simple-async-result.c
index 76e6cf6..dcec35b 100644
--- a/e-util/e-simple-async-result.c
+++ b/e-util/e-simple-async-result.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gio/gio.h>
 
diff --git a/e-util/e-source-combo-box.c b/e-util/e-source-combo-box.c
index 61dd756..93bbc53 100644
--- a/e-util/e-source-combo-box.c
+++ b/e-util/e-source-combo-box.c
@@ -16,9 +16,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libedataserverui/libedataserverui.h>
 
diff --git a/e-util/e-source-config-dialog.c b/e-util/e-source-config-dialog.c
index d7b4d55..1f48d10 100644
--- a/e-util/e-source-config-dialog.c
+++ b/e-util/e-source-config-dialog.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-source-config.c b/e-util/e-source-config.c
index d53a54e..066cf10 100644
--- a/e-util/e-source-config.c
+++ b/e-util/e-source-config.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-source-config.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
@@ -27,6 +26,8 @@
 #include "e-misc-utils.h"
 #include "e-source-config-backend.h"
 
+#include "e-source-config.h"
+
 #define E_SOURCE_CONFIG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_SOURCE_CONFIG, ESourceConfigPrivate))
diff --git a/e-util/e-source-selector-dialog.c b/e-util/e-source-selector-dialog.c
index b54ee71..6b6b6f9 100644
--- a/e-util/e-source-selector-dialog.c
+++ b/e-util/e-source-selector-dialog.c
@@ -18,9 +18,7 @@
  * Author: Rodrigo Moya <rodrigo novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include "e-source-selector.h"
diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c
index a32dc16..49392da 100644
--- a/e-util/e-source-selector.c
+++ b/e-util/e-source-selector.c
@@ -18,9 +18,7 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-spell-checker.c b/e-util/e-spell-checker.c
index dbdd895..fc5a0ff 100644
--- a/e-util/e-spell-checker.c
+++ b/e-util/e-spell-checker.c
@@ -16,9 +16,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-spell-checker.h"
 #include "e-spell-dictionary.h"
diff --git a/e-util/e-spell-dictionary.c b/e-util/e-spell-dictionary.c
index 6b221ab..ab89f55 100644
--- a/e-util/e-spell-dictionary.c
+++ b/e-util/e-spell-dictionary.c
@@ -16,9 +16,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util-private.h"
 #include "e-spell-dictionary.h"
diff --git a/e-util/e-spell-entry.c b/e-util/e-spell-entry.c
index b48390c..9a328a3 100644
--- a/e-util/e-spell-entry.c
+++ b/e-util/e-spell-entry.c
@@ -17,7 +17,8 @@
 
 /* This code is based on libsexy's SexySpellEntry */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
 
diff --git a/e-util/e-spell-text-view.c b/e-util/e-spell-text-view.c
index e6f4412..8101341 100644
--- a/e-util/e-spell-text-view.c
+++ b/e-util/e-spell-text-view.c
@@ -17,13 +17,11 @@
 
 /* Just a proxy for GtkSpell Text View spell checker */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
-#ifdef WITH_GTKSPELL
+#ifdef HAVE_GTKSPELL
 #include <gtkspell/gtkspell.h>
 #endif
 
@@ -43,11 +41,11 @@
 gboolean
 e_spell_text_view_is_supported (void)
 {
-#ifdef WITH_GTKSPELL
+#ifdef HAVE_GTKSPELL
        return TRUE;
-#else /* WITH_GTKSPELL */
+#else /* HAVE_GTKSPELL */
        return FALSE;
-#endif /* WITH_GTKSPELL */
+#endif /* HAVE_GTKSPELL */
 }
 
 /**
@@ -64,7 +62,7 @@ e_spell_text_view_is_supported (void)
 gboolean
 e_spell_text_view_attach (GtkTextView *text_view)
 {
-#ifdef WITH_GTKSPELL
+#ifdef HAVE_GTKSPELL
        GtkSpellChecker *spell;
        GSettings *settings;
        gchar **strv;
@@ -90,9 +88,9 @@ e_spell_text_view_attach (GtkTextView *text_view)
        g_strfreev (strv);
 
        return success;
-#else /* WITH_GTKSPELL */
+#else /* HAVE_GTKSPELL */
        return FALSE;
-#endif /* WITH_GTKSPELL */
+#endif /* HAVE_GTKSPELL */
 }
 
 /**
@@ -108,11 +106,11 @@ e_spell_text_view_attach (GtkTextView *text_view)
 void
 e_spell_text_view_recheck_all (GtkTextView *text_view)
 {
-#ifdef WITH_GTKSPELL
+#ifdef HAVE_GTKSPELL
        GtkSpellChecker *spell;
 
        spell = gtk_spell_checker_get_from_text_view (text_view);
        if (spell)
                gtk_spell_checker_recheck_all (spell);
-#endif /* WITH_GTKSPELL */
+#endif /* HAVE_GTKSPELL */
 }
diff --git a/e-util/e-spinner.c b/e-util/e-spinner.c
index 8a4b972..5d1dae6 100644
--- a/e-util/e-spinner.c
+++ b/e-util/e-spinner.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-stock-request.c b/e-util/e-stock-request.c
index c550a2c..56d8fa7 100644
--- a/e-util/e-stock-request.c
+++ b/e-util/e-stock-request.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-click-to-add.c b/e-util/e-table-click-to-add.c
index 5d4eb9a..386cb87 100644
--- a/e-util/e-table-click-to-add.c
+++ b/e-util/e-table-click-to-add.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-click-to-add.h"
 
diff --git a/e-util/e-table-col.c b/e-util/e-table-col.c
index df93282..4bebad2 100644
--- a/e-util/e-table-col.c
+++ b/e-util/e-table-col.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/e-util/e-table-column-selector.c b/e-util/e-table-column-selector.c
index beab157..85b0b0b 100644
--- a/e-util/e-table-column-selector.c
+++ b/e-util/e-table-column-selector.c
@@ -24,12 +24,12 @@
  * available columns of an #ETable or #ETree.
  **/
 
-#include "e-table-column-selector.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
-#include "e-util/e-table-specification.h"
+#include "e-table-specification.h"
+#include "e-table-column-selector.h"
 
 #define E_TABLE_COLUMN_SELECTOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-table-column-specification.c b/e-util/e-table-column-specification.c
index da42a41..bf5df71 100644
--- a/e-util/e-table-column-specification.c
+++ b/e-util/e-table-column-specification.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-column-specification.h"
 
diff --git a/e-util/e-table-config.c b/e-util/e-table-config.c
index 3d928b8..8317c49 100644
--- a/e-util/e-table-config.c
+++ b/e-util/e-table-config.c
@@ -26,12 +26,12 @@
  *    Make Clear all work.
  */
 
-#include "e-table-config.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n.h>
 
 #include "e-table-column-selector.h"
+#include "e-table-config.h"
 
 G_DEFINE_TYPE (ETableConfig, e_table_config, G_TYPE_OBJECT)
 
diff --git a/e-util/e-table-extras.c b/e-util/e-table-extras.c
index 8f43a1f..71f2797 100644
--- a/e-util/e-table-extras.c
+++ b/e-util/e-table-extras.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-field-chooser-dialog.c b/e-util/e-table-field-chooser-dialog.c
index 88b3962..0039567 100644
--- a/e-util/e-table-field-chooser-dialog.c
+++ b/e-util/e-table-field-chooser-dialog.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/e-util/e-table-field-chooser-item.c b/e-util/e-table-field-chooser-item.c
index 4ab2526..a63167f 100644
--- a/e-util/e-table-field-chooser-item.c
+++ b/e-util/e-table-field-chooser-item.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-table-field-chooser.c b/e-util/e-table-field-chooser.c
index d36fccb..3dfe57c 100644
--- a/e-util/e-table-field-chooser.c
+++ b/e-util/e-table-field-chooser.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-field-chooser.h"
 
diff --git a/e-util/e-table-group-container.c b/e-util/e-table-group-container.c
index 850e018..7b9d339 100644
--- a/e-util/e-table-group-container.c
+++ b/e-util/e-table-group-container.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-group-container.h"
 
diff --git a/e-util/e-table-group-leaf.c b/e-util/e-table-group-leaf.c
index ffdb8b9..dc5710e 100644
--- a/e-util/e-table-group-leaf.c
+++ b/e-util/e-table-group-leaf.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-group-leaf.h"
 
diff --git a/e-util/e-table-group.c b/e-util/e-table-group.c
index 32c4aae..d41d82e 100644
--- a/e-util/e-table-group.c
+++ b/e-util/e-table-group.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libgnomecanvas/libgnomecanvas.h>
diff --git a/e-util/e-table-header-item.c b/e-util/e-table-header-item.c
index 63d873b..7fbde32 100644
--- a/e-util/e-table-header-item.c
+++ b/e-util/e-table-header-item.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-header-item.h"
 
diff --git a/e-util/e-table-header-utils.c b/e-util/e-table-header-utils.c
index 582791b..9be35c9 100644
--- a/e-util/e-table-header-utils.c
+++ b/e-util/e-table-header-utils.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-header-utils.h"
 
diff --git a/e-util/e-table-header.c b/e-util/e-table-header.c
index 37bb6c0..1c1255f 100644
--- a/e-util/e-table-header.c
+++ b/e-util/e-table-header.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-table-item.c b/e-util/e-table-item.c
index f2bbad6..0ef48b1 100644
--- a/e-util/e-table-item.c
+++ b/e-util/e-table-item.c
@@ -25,9 +25,8 @@
  * TODO:
  *   Add a border to the thing, so that focusing works properly.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include "e-table-item.h"
 
diff --git a/e-util/e-table-one.c b/e-util/e-table-one.c
index 338ad66..57aeb9f 100644
--- a/e-util/e-table-one.c
+++ b/e-util/e-table-one.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-one.h"
 
diff --git a/e-util/e-table-search.c b/e-util/e-table-search.c
index 6ce6a86..4452a3f 100644
--- a/e-util/e-table-search.c
+++ b/e-util/e-table-search.c
@@ -19,14 +19,14 @@
  *
  */
 
-#include "e-table-search.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <libedataserver/libedataserver.h>
 
 #include "e-marshal.h"
+#include "e-table-search.h"
 
 #define d(x)
 
diff --git a/e-util/e-table-selection-model.c b/e-util/e-table-selection-model.c
index 56cc1b3..c85ffd8 100644
--- a/e-util/e-table-selection-model.c
+++ b/e-util/e-table-selection-model.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-table-sorted-variable.c b/e-util/e-table-sorted-variable.c
index 065fe54..8352d47 100644
--- a/e-util/e-table-sorted-variable.c
+++ b/e-util/e-table-sorted-variable.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-sorted.c b/e-util/e-table-sorted.c
index beed341..10cf8fa 100644
--- a/e-util/e-table-sorted.c
+++ b/e-util/e-table-sorted.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-sorter.c b/e-util/e-table-sorter.c
index 5efc39e..6ffdf29 100644
--- a/e-util/e-table-sorter.c
+++ b/e-util/e-table-sorter.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-sorting-utils.c b/e-util/e-table-sorting-utils.c
index 68f673c..ea9b53a 100644
--- a/e-util/e-table-sorting-utils.c
+++ b/e-util/e-table-sorting-utils.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-sorting-utils.h"
 
diff --git a/e-util/e-table-subset-variable.c b/e-util/e-table-subset-variable.c
index e88ec3d..3340c97 100644
--- a/e-util/e-table-subset-variable.c
+++ b/e-util/e-table-subset-variable.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-table-subset.c b/e-util/e-table-subset.c
index b00dfb6..e825325 100644
--- a/e-util/e-table-subset.c
+++ b/e-util/e-table-subset.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 
diff --git a/e-util/e-table-utils.c b/e-util/e-table-utils.c
index 9e3072b..b49cafd 100644
--- a/e-util/e-table-utils.c
+++ b/e-util/e-table-utils.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table-utils.h"
 
diff --git a/e-util/e-table.c b/e-util/e-table.c
index 450810a..685ee12 100644
--- a/e-util/e-table.c
+++ b/e-util/e-table.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-table.h"
 
diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c
index a99529a..d161c1f 100644
--- a/e-util/e-text-event-processor-emacs-like.c
+++ b/e-util/e-text-event-processor-emacs-like.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c
index 9e2a4a9..b694b82 100644
--- a/e-util/e-text-event-processor.c
+++ b/e-util/e-text-event-processor.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/e-util/e-text-model-repos.c b/e-util/e-text-model-repos.c
index 99c9cfb..c51c8ef 100644
--- a/e-util/e-text-model-repos.c
+++ b/e-util/e-text-model-repos.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-text-model-repos.h"
 
diff --git a/e-util/e-text-model.c b/e-util/e-text-model.c
index a6fecdb..a0bc2fe 100644
--- a/e-util/e-text-model.c
+++ b/e-util/e-text-model.c
@@ -21,9 +21,7 @@
 
 #undef  PARANOID_DEBUGGING
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-text-model.h"
 
diff --git a/e-util/e-text.c b/e-util/e-text.c
index 34ad317..38b5e73 100644
--- a/e-util/e-text.c
+++ b/e-util/e-text.c
@@ -34,9 +34,8 @@
  * 02110-1301, USA.
  */
 
-#include "e-text.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <math.h>
 #include <ctype.h>
 #include <string.h>
@@ -55,6 +54,8 @@
 #include "e-misc-utils.h"
 #include "gal-a11y-e-text.h"
 
+#include "e-text.h"
+
 G_DEFINE_TYPE (EText, e_text, GNOME_TYPE_CANVAS_ITEM)
 
 enum {
diff --git a/e-util/e-timezone-dialog.c b/e-util/e-timezone-dialog.c
index 297ac97..3f613ae 100644
--- a/e-util/e-timezone-dialog.c
+++ b/e-util/e-timezone-dialog.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-timezone-dialog.h"
 
diff --git a/e-util/e-tree-model-generator.c b/e-util/e-tree-model-generator.c
index 81c4086..b8fe4a3 100644
--- a/e-util/e-tree-model-generator.c
+++ b/e-util/e-tree-model-generator.c
@@ -19,9 +19,7 @@
  * Authors: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-tree-selection-model.c b/e-util/e-tree-selection-model.c
index d19cbb4..63a6c0e 100644
--- a/e-util/e-tree-selection-model.c
+++ b/e-util/e-tree-selection-model.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-tree-selection-model.h"
 
diff --git a/e-util/e-tree-view-frame.c b/e-util/e-tree-view-frame.c
index 716f480..8052e5d 100644
--- a/e-util/e-tree-view-frame.c
+++ b/e-util/e-tree-view-frame.c
@@ -29,9 +29,7 @@
  * extended through e_tree_view_frame_insert_toolbar_action().
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libebackend/libebackend.h>
 
diff --git a/e-util/e-tree.c b/e-util/e-tree.c
index 19f83c5..49e685a 100644
--- a/e-util/e-tree.c
+++ b/e-util/e-tree.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/e-util/e-unicode.c b/e-util/e-unicode.c
index a0d5950..d386b37 100644
--- a/e-util/e-unicode.c
+++ b/e-util/e-unicode.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdlib.h>
 #include <string.h>
diff --git a/e-util/e-url-entry.c b/e-util/e-url-entry.c
index 6e8d94c..d86ef40 100644
--- a/e-util/e-url-entry.c
+++ b/e-util/e-url-entry.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-url-entry.h"
 
diff --git a/e-util/e-web-view-preview.c b/e-util/e-web-view-preview.c
index 13fd32d..9bac835 100644
--- a/e-util/e-web-view-preview.c
+++ b/e-util/e-web-view-preview.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-web-view-preview.h"
 
diff --git a/e-util/e-web-view.c b/e-util/e-web-view.c
index 42ccad8..d3b85ad 100644
--- a/e-util/e-web-view.c
+++ b/e-util/e-web-view.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-web-view.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <math.h>
@@ -40,7 +39,9 @@
 #include "e-selectable.h"
 #include "e-stock-request.h"
 
-#include <web-extensions/e-web-extension-names.h>
+#include "web-extensions/e-web-extension-names.h"
+
+#include "e-web-view.h"
 
 #define E_WEB_VIEW_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/e-util/e-widget-undo.c b/e-util/e-widget-undo.c
index 9efe760..77f220f 100644
--- a/e-util/e-widget-undo.c
+++ b/e-util/e-widget-undo.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
diff --git a/e-util/e-win32-defaults.c b/e-util/e-win32-defaults.c
index f447706..3a43207 100644
--- a/e-util/e-win32-defaults.c
+++ b/e-util/e-win32-defaults.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <windows.h>
 
diff --git a/e-util/e-win32-reloc.c b/e-util/e-win32-reloc.c
index 2c559cf..9a72905 100644
--- a/e-util/e-win32-reloc.c
+++ b/e-util/e-win32-reloc.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <windows.h>
 #include <string.h>
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index c3f9a03..43cc0e5 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-xml-utils.h"
 
diff --git a/e-util/ea-calendar-cell.c b/e-util/ea-calendar-cell.c
index e15b1ae..d527ff2 100644
--- a/e-util/ea-calendar-cell.c
+++ b/e-util/ea-calendar-cell.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include "ea-calendar-cell.h"
diff --git a/e-util/ea-calendar-item.c b/e-util/ea-calendar-item.c
index b620777..c22adfb 100644
--- a/e-util/ea-calendar-item.c
+++ b/e-util/ea-calendar-item.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <time.h>
diff --git a/e-util/ea-cell-table.c b/e-util/ea-cell-table.c
index dd1e647..c1ee374 100644
--- a/e-util/ea-cell-table.c
+++ b/e-util/ea-cell-table.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-cell-table.h"
 
diff --git a/e-util/ea-widgets.c b/e-util/ea-widgets.c
index d16aefc..12bf191 100644
--- a/e-util/ea-widgets.c
+++ b/e-util/ea-widgets.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ea-factory.h"
 #include "ea-calendar-item.h"
diff --git a/e-util/evolution-source-viewer.c b/e-util/evolution-source-viewer.c
index 61c5880..069d625 100644
--- a/e-util/evolution-source-viewer.c
+++ b/e-util/evolution-source-viewer.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
diff --git a/e-util/gal-a11y-e-cell-popup.c b/e-util/gal-a11y-e-cell-popup.c
index 2744a1c..afa3e20 100644
--- a/e-util/gal-a11y-e-cell-popup.c
+++ b/e-util/gal-a11y-e-cell-popup.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell-popup.h"
 
diff --git a/e-util/gal-a11y-e-cell-registry.c b/e-util/gal-a11y-e-cell-registry.c
index 54f9d0b..407d004 100644
--- a/e-util/gal-a11y-e-cell-registry.c
+++ b/e-util/gal-a11y-e-cell-registry.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell.h"
 #include "gal-a11y-e-cell-registry.h"
diff --git a/e-util/gal-a11y-e-cell-text.c b/e-util/gal-a11y-e-cell-text.c
index db65078..d8e994e 100644
--- a/e-util/gal-a11y-e-cell-text.c
+++ b/e-util/gal-a11y-e-cell-text.c
@@ -20,7 +20,7 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/e-util/gal-a11y-e-cell-toggle.c b/e-util/gal-a11y-e-cell-toggle.c
index ef4b274..6dabc6b 100644
--- a/e-util/gal-a11y-e-cell-toggle.c
+++ b/e-util/gal-a11y-e-cell-toggle.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell-toggle.h"
 
diff --git a/e-util/gal-a11y-e-cell-tree.c b/e-util/gal-a11y-e-cell-tree.c
index 1b20aed..5d39508 100644
--- a/e-util/gal-a11y-e-cell-tree.c
+++ b/e-util/gal-a11y-e-cell-tree.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell-tree.h"
 
diff --git a/e-util/gal-a11y-e-cell-vbox.c b/e-util/gal-a11y-e-cell-vbox.c
index c998eed..bdec15c 100644
--- a/e-util/gal-a11y-e-cell-vbox.c
+++ b/e-util/gal-a11y-e-cell-vbox.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell-vbox.h"
 
diff --git a/e-util/gal-a11y-e-cell.c b/e-util/gal-a11y-e-cell.c
index 537f998..bd4ed25 100644
--- a/e-util/gal-a11y-e-cell.c
+++ b/e-util/gal-a11y-e-cell.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-cell.h"
 
diff --git a/e-util/gal-a11y-e-table-click-to-add-factory.c b/e-util/gal-a11y-e-table-click-to-add-factory.c
index e3c0b38..d01a5ee 100644
--- a/e-util/gal-a11y-e-table-click-to-add-factory.c
+++ b/e-util/gal-a11y-e-table-click-to-add-factory.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table-click-to-add-factory.h"
 
diff --git a/e-util/gal-a11y-e-table-click-to-add.c b/e-util/gal-a11y-e-table-click-to-add.c
index 120bf15..6eff5c8 100644
--- a/e-util/gal-a11y-e-table-click-to-add.c
+++ b/e-util/gal-a11y-e-table-click-to-add.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table-click-to-add.h"
 
diff --git a/e-util/gal-a11y-e-table-column-header.c b/e-util/gal-a11y-e-table-column-header.c
index 55618aa..ee5ea3b 100644
--- a/e-util/gal-a11y-e-table-column-header.c
+++ b/e-util/gal-a11y-e-table-column-header.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table-column-header.h"
 
diff --git a/e-util/gal-a11y-e-table-factory.c b/e-util/gal-a11y-e-table-factory.c
index f6885c1..f4fdfca 100644
--- a/e-util/gal-a11y-e-table-factory.c
+++ b/e-util/gal-a11y-e-table-factory.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table.h"
 #include "gal-a11y-e-table-factory.h"
diff --git a/e-util/gal-a11y-e-table-item-factory.c b/e-util/gal-a11y-e-table-item-factory.c
index 65b449a..acb2d80 100644
--- a/e-util/gal-a11y-e-table-item-factory.c
+++ b/e-util/gal-a11y-e-table-item-factory.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table-item-factory.h"
 
diff --git a/e-util/gal-a11y-e-table-item.c b/e-util/gal-a11y-e-table-item.c
index 11e82cd..cf06fb3 100644
--- a/e-util/gal-a11y-e-table-item.c
+++ b/e-util/gal-a11y-e-table-item.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table-item.h"
 
diff --git a/e-util/gal-a11y-e-table.c b/e-util/gal-a11y-e-table.c
index e766b18..7f13789 100644
--- a/e-util/gal-a11y-e-table.c
+++ b/e-util/gal-a11y-e-table.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-table.h"
 
diff --git a/e-util/gal-a11y-e-text-factory.c b/e-util/gal-a11y-e-text-factory.c
index 9b7d3fc..359fc94 100644
--- a/e-util/gal-a11y-e-text-factory.c
+++ b/e-util/gal-a11y-e-text-factory.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-text.h"
 #include "gal-a11y-e-text-factory.h"
diff --git a/e-util/gal-a11y-e-text.c b/e-util/gal-a11y-e-text.c
index 950b923..cc10fe5 100644
--- a/e-util/gal-a11y-e-text.c
+++ b/e-util/gal-a11y-e-text.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-text.h"
 
diff --git a/e-util/gal-a11y-e-tree-factory.c b/e-util/gal-a11y-e-tree-factory.c
index f218052..81c53e9 100644
--- a/e-util/gal-a11y-e-tree-factory.c
+++ b/e-util/gal-a11y-e-tree-factory.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-tree.h"
 #include "gal-a11y-e-tree-factory.h"
diff --git a/e-util/gal-a11y-e-tree.c b/e-util/gal-a11y-e-tree.c
index fb0a224..e19e73b 100644
--- a/e-util/gal-a11y-e-tree.c
+++ b/e-util/gal-a11y-e-tree.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-e-tree.h"
 
diff --git a/e-util/gal-a11y-util.c b/e-util/gal-a11y-util.c
index bcb993c..59db1cc 100644
--- a/e-util/gal-a11y-util.c
+++ b/e-util/gal-a11y-util.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-a11y-util.h"
 
diff --git a/e-util/gal-view-instance-save-as-dialog.c b/e-util/gal-view-instance-save-as-dialog.c
index 361fdd3..f6cbcfd 100644
--- a/e-util/gal-view-instance-save-as-dialog.c
+++ b/e-util/gal-view-instance-save-as-dialog.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/e-util/gal-view-instance.c b/e-util/gal-view-instance.c
index 109a5fa..03b957b 100644
--- a/e-util/gal-view-instance.c
+++ b/e-util/gal-view-instance.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gal-view-instance.h"
 
diff --git a/e-util/test-calendar.c b/e-util/test-calendar.c
index 2a64a4f..3c4dc77 100644
--- a/e-util/test-calendar.c
+++ b/e-util/test-calendar.c
@@ -23,9 +23,7 @@
  * test-calendar - tests the ECalendar widget.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <e-util/e-util.h>
diff --git a/e-util/test-dateedit.c b/e-util/test-dateedit.c
index 03e8df1..def69db 100644
--- a/e-util/test-dateedit.c
+++ b/e-util/test-dateedit.c
@@ -23,9 +23,7 @@
  * test-dateedit - tests the EDateEdit widget.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include "e-dateedit.h"
diff --git a/e-util/test-html-editor-units-bugs.c b/e-util/test-html-editor-units-bugs.c
index b7dbfe3..181a070 100644
--- a/e-util/test-html-editor-units-bugs.c
+++ b/e-util/test-html-editor-units-bugs.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <e-util/e-util.h>
 
diff --git a/e-util/test-html-editor-units-utils.c b/e-util/test-html-editor-units-utils.c
index 90fbbf6..7fb8325 100644
--- a/e-util/test-html-editor-units-utils.c
+++ b/e-util/test-html-editor-units-utils.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/e-util/test-html-editor-units.c b/e-util/test-html-editor-units.c
index 44fe89d..27c4a6a 100644
--- a/e-util/test-html-editor-units.c
+++ b/e-util/test-html-editor-units.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gstdio.h>
diff --git a/e-util/test-html-editor.c b/e-util/test-html-editor.c
index d7d6f60..c567c28 100644
--- a/e-util/test-html-editor.c
+++ b/e-util/test-html-editor.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <e-util/e-util.h>
diff --git a/e-util/test-keyfile-settings-backend.c b/e-util/test-keyfile-settings-backend.c
index 9e28b23..b3ba28a 100644
--- a/e-util/test-keyfile-settings-backend.c
+++ b/e-util/test-keyfile-settings-backend.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <gio/gio.h>
diff --git a/e-util/test-source-combo-box.c b/e-util/test-source-combo-box.c
index c365aa1..334ba86 100644
--- a/e-util/test-source-combo-box.c
+++ b/e-util/test-source-combo-box.c
@@ -18,7 +18,8 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <gtk/gtk.h>
 
 #include <e-util/e-util.h>
diff --git a/em-format/CMakeLists.txt b/em-format/CMakeLists.txt
new file mode 100644
index 0000000..9d0b721
--- /dev/null
+++ b/em-format/CMakeLists.txt
@@ -0,0 +1,146 @@
+glib_mkenums(e-mail-formatter-enumtypes e-mail-formatter-enums.h E_MAIL_FORMATTER_ENUMTYPES_H)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       e-mail-extension-registry.c
+       e-mail-inline-filter.c
+       e-mail-formatter.c
+       e-mail-formatter-print.c
+       e-mail-formatter-quote.c
+       e-mail-formatter-utils.c
+       e-mail-formatter-attachment.c
+       e-mail-formatter-audio.c
+       e-mail-formatter-error.c
+       e-mail-formatter-extension.c
+       e-mail-formatter-headers.c
+       e-mail-formatter-image.c
+       e-mail-formatter-message-rfc822.c
+       e-mail-formatter-secure-button.c
+       e-mail-formatter-source.c
+       e-mail-formatter-text-enriched.c
+       e-mail-formatter-text-html.c
+       e-mail-formatter-text-plain.c
+       e-mail-formatter-print-headers.c
+       e-mail-formatter-quote-headers.c
+       e-mail-formatter-quote-message-rfc822.c
+       e-mail-formatter-quote-text-enriched.c
+       e-mail-formatter-quote-text-html.c
+       e-mail-formatter-quote-text-plain.c
+       e-mail-parser-extension.c
+       e-mail-parser.c
+       e-mail-parser-application-mbox.c
+       e-mail-parser-audio.c
+       e-mail-parser-headers.c
+       e-mail-parser-image.c
+       e-mail-parser-inlinepgp-encrypted.c
+       e-mail-parser-inlinepgp-signed.c
+       e-mail-parser-message.c
+       e-mail-parser-message-deliverystatus.c
+       e-mail-parser-message-external.c
+       e-mail-parser-message-rfc822.c
+       e-mail-parser-multipart-alternative.c
+       e-mail-parser-multipart-appledouble.c
+       e-mail-parser-multipart-digest.c
+       e-mail-parser-multipart-encrypted.c
+       e-mail-parser-multipart-mixed.c
+       e-mail-parser-multipart-related.c
+       e-mail-parser-multipart-signed.c
+       e-mail-parser-secure-button.c
+       e-mail-parser-source.c
+       e-mail-parser-text-enriched.c
+       e-mail-parser-text-html.c
+       e-mail-parser-text-plain.c
+       e-mail-part.c
+       e-mail-part-attachment.c
+       e-mail-part-audio.c
+       e-mail-part-headers.c
+       e-mail-part-image.c
+       e-mail-part-list.c
+       e-mail-part-secure-button.c
+       e-mail-part-utils.c
+       e-mail-stripsig-filter.c
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-formatter-enumtypes.c
+)
+
+if(ENABLE_SMIME)
+       list(APPEND DEPENDENCIES
+               essmime
+               evolution-smime
+       )
+
+       list(APPEND SOURCES
+               e-mail-parser-application-smime.c
+       )
+endif(ENABLE_SMIME)
+
+set(HEADERS
+       e-mail-extension-registry.h
+       e-mail-formatter-extension.h
+       e-mail-formatter.h
+       e-mail-formatter-enums.h
+       e-mail-formatter-print.h
+       e-mail-formatter-quote.h
+       e-mail-formatter-utils.h
+       e-mail-inline-filter.h
+       e-mail-parser-extension.h
+       e-mail-parser.h
+       e-mail-part.h
+       e-mail-part-attachment.h
+       e-mail-part-audio.h
+       e-mail-part-headers.h
+       e-mail-part-image.h
+       e-mail-part-list.h
+       e-mail-part-secure-button.h
+       e-mail-part-utils.h
+       e-mail-stripsig-filter.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-formatter-enumtypes.h
+)
+
+add_library(evolution-mail-formatter SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-mail-formatter
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-formatter PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-mail-formatter\"
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-mail-formatter PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-formatter PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/smime/lib
+       ${CMAKE_SOURCE_DIR}/smime/gui
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-formatter
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-formatter
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/em-format
+)
diff --git a/em-format/e-mail-extension-registry.c b/em-format/e-mail-extension-registry.c
index 4a02bf5..e2f7b68 100644
--- a/em-format/e-mail-extension-registry.c
+++ b/em-format/e-mail-extension-registry.c
@@ -41,7 +41,7 @@ G_DEFINE_ABSTRACT_TYPE (
  * EMailExtensionRegistry:
  *
  * The #EMailExtensionRegistry is an abstract class representing a registry
- * for #EMailExtension<!-//>s.
+ * for #EMailExtension<!-- -->s.
  *
  * #EMailParser and #EMailFormatter both have internally a registry object
  * based on the #EMailExtensionRegistry.
@@ -144,10 +144,10 @@ e_mail_extension_registry_init (EMailExtensionRegistry *registry)
  * @registry: An #EMailExtensionRegistry
  * @mime_type: A string with mime-type to look up
  *
- * Tries to lookup list of #EMailExtension<!-//>s that has registryed themselves
+ * Tries to lookup list of #EMailExtension<!-- -->s that has registryed themselves
  * as handlers for the @mime_type.
  *
- * Return value: Returns #GQueue of #EMailExtension<!-//>s or %NULL when there
+ * Return value: Returns #GQueue of #EMailExtension<!-- -->s or %NULL when there
  * are no extension registryed for given @mime_type.
  */
 GQueue *
@@ -168,7 +168,7 @@ e_mail_extension_registry_get_for_mime_type (EMailExtensionRegistry *registry,
  * Tries to lookup fallback parsers for given mime type. For instance, for
  * multipart/alternative, it will try to lookup multipart/ * parser.
  *
- * Return Value: Returns #QGueue of #EMailExtension<!-//>>s or %NULL when there
+ * Return Value: Returns #QGueue of #EMailExtension<!-- -->s or %NULL when there
  * are no extensions registryed for the fallback type.
  */
 GQueue *
diff --git a/em-format/e-mail-formatter-attachment.c b/em-format/e-mail-formatter-attachment.c
index 86a39ef..7430fb2 100644
--- a/em-format/e-mail-formatter-attachment.c
+++ b/em-format/e-mail-formatter-attachment.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-audio.c b/em-format/e-mail-formatter-audio.c
index 2837000..eaaf382 100644
--- a/em-format/e-mail-formatter-audio.c
+++ b/em-format/e-mail-formatter-audio.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-error.c b/em-format/e-mail-formatter-error.c
index 10993d7..40fe2b9 100644
--- a/em-format/e-mail-formatter-error.c
+++ b/em-format/e-mail-formatter-error.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-headers.c b/em-format/e-mail-formatter-headers.c
index 2affbe1..a397cb0 100644
--- a/em-format/e-mail-formatter-headers.c
+++ b/em-format/e-mail-formatter-headers.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-image.c b/em-format/e-mail-formatter-image.c
index 619082f..70ca898 100644
--- a/em-format/e-mail-formatter-image.c
+++ b/em-format/e-mail-formatter-image.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c
index 7f8d6ef..2e77d9f 100644
--- a/em-format/e-mail-formatter-message-rfc822.c
+++ b/em-format/e-mail-formatter-message-rfc822.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-print-headers.c b/em-format/e-mail-formatter-print-headers.c
index ae2e5c1..a7e8eb2 100644
--- a/em-format/e-mail-formatter-print-headers.c
+++ b/em-format/e-mail-formatter-print-headers.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-quote-headers.c b/em-format/e-mail-formatter-quote-headers.c
index 68212d7..01a77dd 100644
--- a/em-format/e-mail-formatter-quote-headers.c
+++ b/em-format/e-mail-formatter-quote-headers.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-quote-message-rfc822.c 
b/em-format/e-mail-formatter-quote-message-rfc822.c
index 7ed0bd4..3dc59ba 100644
--- a/em-format/e-mail-formatter-quote-message-rfc822.c
+++ b/em-format/e-mail-formatter-quote-message-rfc822.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-quote-text-enriched.c 
b/em-format/e-mail-formatter-quote-text-enriched.c
index 679ab7c..0dc761e 100644
--- a/em-format/e-mail-formatter-quote-text-enriched.c
+++ b/em-format/e-mail-formatter-quote-text-enriched.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-quote-text-html.c b/em-format/e-mail-formatter-quote-text-html.c
index 8c6433c..32fa8a7 100644
--- a/em-format/e-mail-formatter-quote-text-html.c
+++ b/em-format/e-mail-formatter-quote-text-html.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-formatter-quote-text-plain.c b/em-format/e-mail-formatter-quote-text-plain.c
index 0b13f5e..817613d 100644
--- a/em-format/e-mail-formatter-quote-text-plain.c
+++ b/em-format/e-mail-formatter-quote-text-plain.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-secure-button.c b/em-format/e-mail-formatter-secure-button.c
index 80cfb09..7eca64f 100644
--- a/em-format/e-mail-formatter-secure-button.c
+++ b/em-format/e-mail-formatter-secure-button.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-source.c b/em-format/e-mail-formatter-source.c
index ed7304f..6c2ecf5 100644
--- a/em-format/e-mail-formatter-source.c
+++ b/em-format/e-mail-formatter-source.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-text-enriched.c b/em-format/e-mail-formatter-text-enriched.c
index 31cc8eb..dc26dcd 100644
--- a/em-format/e-mail-formatter-text-enriched.c
+++ b/em-format/e-mail-formatter-text-enriched.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c
index 7f4a81c..1afcf15 100644
--- a/em-format/e-mail-formatter-text-html.c
+++ b/em-format/e-mail-formatter-text-html.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <string.h>
diff --git a/em-format/e-mail-formatter-text-plain.c b/em-format/e-mail-formatter-text-plain.c
index 39ab253..d816d98 100644
--- a/em-format/e-mail-formatter-text-plain.c
+++ b/em-format/e-mail-formatter-text-plain.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-formatter-utils.c b/em-format/e-mail-formatter-utils.c
index b890c45..b24167d 100644
--- a/em-format/e-mail-formatter-utils.c
+++ b/em-format/e-mail-formatter-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-formatter-utils.h"
 #include "e-mail-part-headers.h"
diff --git a/em-format/e-mail-inline-filter.c b/em-format/e-mail-inline-filter.c
index f52e970..91bfcfc 100644
--- a/em-format/e-mail-inline-filter.c
+++ b/em-format/e-mail-inline-filter.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c
index 21c2426..c4e9ecd 100644
--- a/em-format/e-mail-parser-application-mbox.c
+++ b/em-format/e-mail-parser-application-mbox.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c
index f3673bf..c7e631b 100644
--- a/em-format/e-mail-parser-application-smime.c
+++ b/em-format/e-mail-parser-application-smime.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-audio.c b/em-format/e-mail-parser-audio.c
index 974d2fa..a29434a 100644
--- a/em-format/e-mail-parser-audio.c
+++ b/em-format/e-mail-parser-audio.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c
index 3030d26..ae9ef7d 100644
--- a/em-format/e-mail-parser-extension.c
+++ b/em-format/e-mail-parser-extension.c
@@ -43,7 +43,7 @@ e_mail_parser_extension_init (EMailParserExtension *extension)
  * @out_mail_parts: a #GQueue to deposit #EMailPart instances
  *
  * A virtual function reimplemented in all mail parser extensions. The function
- * decodes and parses the @mime_part, appending one or more #EMailPart<!-//>s
+ * decodes and parses the @mime_part, appending one or more #EMailPart<!-- -->s
  * to the @out_mail_parts queue.
  *
  * When the function is unable to parse the @mime_part (either because it's
@@ -62,7 +62,7 @@ e_mail_parser_extension_init (EMailParserExtension *extension)
  * Implementation of this function must be thread-safe.
  *
  * Returns: %TRUE if the @mime_part was handled (even if no
- *          #EMailPart<!-//>s were added to @out_mail_parts), or
+ *          #EMailPart<!-- -->s were added to @out_mail_parts), or
  *          %FALSE if the @mime_part was not handled
  */
 gboolean
diff --git a/em-format/e-mail-parser-headers.c b/em-format/e-mail-parser-headers.c
index 2d446a3..c1ac5a4 100644
--- a/em-format/e-mail-parser-headers.c
+++ b/em-format/e-mail-parser-headers.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-image.c b/em-format/e-mail-parser-image.c
index 7f4d854..3a0bc99 100644
--- a/em-format/e-mail-parser-image.c
+++ b/em-format/e-mail-parser-image.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-inlinepgp-encrypted.c b/em-format/e-mail-parser-inlinepgp-encrypted.c
index bdabcb8..3a19d8c 100644
--- a/em-format/e-mail-parser-inlinepgp-encrypted.c
+++ b/em-format/e-mail-parser-inlinepgp-encrypted.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-inlinepgp-signed.c b/em-format/e-mail-parser-inlinepgp-signed.c
index 84f38bd..2ac8c3a 100644
--- a/em-format/e-mail-parser-inlinepgp-signed.c
+++ b/em-format/e-mail-parser-inlinepgp-signed.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-message-deliverystatus.c 
b/em-format/e-mail-parser-message-deliverystatus.c
index bbf26de..f85e8d1 100644
--- a/em-format/e-mail-parser-message-deliverystatus.c
+++ b/em-format/e-mail-parser-message-deliverystatus.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-message-external.c b/em-format/e-mail-parser-message-external.c
index 72fa66a..a8f191e 100644
--- a/em-format/e-mail-parser-message-external.c
+++ b/em-format/e-mail-parser-message-external.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <ctype.h>
diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c
index 372b801..f690502 100644
--- a/em-format/e-mail-parser-message-rfc822.c
+++ b/em-format/e-mail-parser-message-rfc822.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c
index 0a3b77f..ab18eba 100644
--- a/em-format/e-mail-parser-message.c
+++ b/em-format/e-mail-parser-message.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-multipart-alternative.c b/em-format/e-mail-parser-multipart-alternative.c
index e023b9c..5853b12 100644
--- a/em-format/e-mail-parser-multipart-alternative.c
+++ b/em-format/e-mail-parser-multipart-alternative.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-multipart-appledouble.c b/em-format/e-mail-parser-multipart-appledouble.c
index cc74fbc..8845f73 100644
--- a/em-format/e-mail-parser-multipart-appledouble.c
+++ b/em-format/e-mail-parser-multipart-appledouble.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-parser-extension.h"
 
diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c
index 83e902c..d8fd277 100644
--- a/em-format/e-mail-parser-multipart-digest.c
+++ b/em-format/e-mail-parser-multipart-digest.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-multipart-encrypted.c b/em-format/e-mail-parser-multipart-encrypted.c
index 6c8a65e..11daa2d 100644
--- a/em-format/e-mail-parser-multipart-encrypted.c
+++ b/em-format/e-mail-parser-multipart-encrypted.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c
index 432fef4..480cb12 100644
--- a/em-format/e-mail-parser-multipart-mixed.c
+++ b/em-format/e-mail-parser-multipart-mixed.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-multipart-related.c b/em-format/e-mail-parser-multipart-related.c
index 6e9956a..f105829 100644
--- a/em-format/e-mail-parser-multipart-related.c
+++ b/em-format/e-mail-parser-multipart-related.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/em-format/e-mail-parser-multipart-signed.c b/em-format/e-mail-parser-multipart-signed.c
index f90d645..a76ca61 100644
--- a/em-format/e-mail-parser-multipart-signed.c
+++ b/em-format/e-mail-parser-multipart-signed.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-secure-button.c b/em-format/e-mail-parser-secure-button.c
index e458598..574fce7 100644
--- a/em-format/e-mail-parser-secure-button.c
+++ b/em-format/e-mail-parser-secure-button.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-source.c b/em-format/e-mail-parser-source.c
index ac18571..4faf56b 100644
--- a/em-format/e-mail-parser-source.c
+++ b/em-format/e-mail-parser-source.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-text-enriched.c b/em-format/e-mail-parser-text-enriched.c
index 5238149..28ad435 100644
--- a/em-format/e-mail-parser-text-enriched.c
+++ b/em-format/e-mail-parser-text-enriched.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-parser-text-html.c b/em-format/e-mail-parser-text-html.c
index 8765ab3..25578e0 100644
--- a/em-format/e-mail-parser-text-html.c
+++ b/em-format/e-mail-parser-text-html.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser-text-plain.c b/em-format/e-mail-parser-text-plain.c
index aa5c55a..572a84f 100644
--- a/em-format/e-mail-parser-text-plain.c
+++ b/em-format/e-mail-parser-text-plain.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <ctype.h>
 #include <glib/gi18n-lib.h>
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index b5fe91e..2ad5892 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-parser.h"
 
@@ -334,7 +332,7 @@ e_mail_parser_new (CamelSession *session)
  * @message: a #CamelMimeMessage
  * @cancellable: (allow-none) a #GCancellable
  *
- * Parses the @message synchronously. Returns a list of #EMailPart<!-//>s which
+ * Parses the @message synchronously. Returns a list of #EMailPart<!-- -->s which
  * represents structure of the message and additional properties of each part.
  *
  * Note that this function can block for a while, so it's not a good idea to call
diff --git a/em-format/e-mail-part-headers.c b/em-format/e-mail-part-headers.c
index 1908c77..da37b81 100644
--- a/em-format/e-mail-part-headers.c
+++ b/em-format/e-mail-part-headers.c
@@ -15,12 +15,12 @@
  *
  */
 
-#include "e-mail-part-headers.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "e-mail-part-list.h"
+#include "e-mail-part-headers.h"
 
 #define E_MAIL_PART_HEADERS_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/em-format/e-mail-part-secure-button.c b/em-format/e-mail-part-secure-button.c
index 2455303..9351e9d 100644
--- a/em-format/e-mail-part-secure-button.c
+++ b/em-format/e-mail-part-secure-button.c
@@ -13,15 +13,13 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
 #include <e-util/e-util.h>
 
-#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
+#if defined (ENABLE_SMIME)
 #include "certificate-manager.h"
 #include "e-cert-db.h"
 #endif
@@ -34,7 +32,7 @@ const gchar *e_mail_formatter_secure_button_get_encrypt_description (CamelCipher
 const gchar *e_mail_formatter_secure_button_get_sign_description (CamelCipherValiditySign status);
 
 
-#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
+#if defined (ENABLE_SMIME)
 static void
 viewcert_clicked (GtkWidget *button,
                   GtkWidget *grid)
@@ -107,14 +105,14 @@ add_cert_table (GtkWidget *grid,
 
                if (l) {
                        GtkWidget *w;
-#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
+#if defined (ENABLE_SMIME)
                        ECert *ec = NULL;
 #endif
                        w = gtk_label_new (l);
                        gtk_misc_set_alignment ((GtkMisc *) w, 0.0, 0.5);
                        g_free (la);
                        gtk_table_attach (table, w, 0, 1, n, n + 1, GTK_FILL, GTK_FILL, 3, 3);
-#if defined (HAVE_NSS) && defined (ENABLE_SMIME)
+#if defined (ENABLE_SMIME)
                        w = gtk_button_new_with_mnemonic (_("_View Certificate"));
                        gtk_table_attach (table, w, 1, 2, n, n + 1, 0, 0, 3, 3);
                        g_object_set_data ((GObject *) w, "e-cert-info", info);
diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c
index 0568a35..011a041 100644
--- a/em-format/e-mail-part-utils.c
+++ b/em-format/e-mail-part-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/em-format/e-mail-part.c b/em-format/e-mail-part.c
index fbfb332..3b16025 100644
--- a/em-format/e-mail-part.c
+++ b/em-format/e-mail-part.c
@@ -26,9 +26,7 @@
  * message.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-part.h"
 
diff --git a/em-format/e-mail-stripsig-filter.c b/em-format/e-mail-stripsig-filter.c
index db68689..e50cee7 100644
--- a/em-format/e-mail-stripsig-filter.c
+++ b/em-format/e-mail-stripsig-filter.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -155,7 +153,7 @@ e_mail_stripsig_filter_init (EMailStripSigFilter *filter)
 /**
  * e_mail_stripsig_filter_new:
  * @text_plain_only: Whether should look for a text/plain signature
- * delimiter "-- \n" only or also an HTML signature delimiter "-- <BR>".
+ * delimiter "-- \n" only or also an HTML signature delimiter "-- &lt;BR&gt;".
  *
  * Creates a new stripsig filter.
  *
diff --git a/evolution-calendar.pc.in b/evolution-calendar.pc.in
index 81f1179..3eb29dd 100644
--- a/evolution-calendar.pc.in
+++ b/evolution-calendar.pc.in
@@ -1,17 +1,13 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
 
 privlibdir=@privsolibdir@
 privincludedir=@privincludedir@
 
-# The requirements list is kind of guesswork at
-# the moment.  Add more requirements as needed.
-
 Name: Evolution Calendar
 Description: Calendar utilities for Evolution
-Version: @VERSION@
-Requires: evolution-shell-3.0
+Version: @PROJECT_VERSION@
+Requires: evolution-shell-@INTERFACE_VERSION@
 Libs: -L${privlibdir} -levolution-calendar
 Cflags: -I${privincludedir}
diff --git a/evolution-mail.pc.in b/evolution-mail.pc.in
index 79b13d2..45207fc 100644
--- a/evolution-mail.pc.in
+++ b/evolution-mail.pc.in
@@ -1,17 +1,13 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
 
 privlibdir=@privsolibdir@
 privincludedir=@privincludedir@
 
-# The requirements list is kind of guesswork at
-# the moment.  Add more requirements as needed.
-
 Name: Evolution Mail
 Description: Mail utilities for Evolution
-Version: @VERSION@
-Requires: evolution-shell-3.0 camel-1.2 libemail-engine
+Version: @PROJECT_VERSION@
+Requires: evolution-shell-@INTERFACE_VERSION@ camel-1.2 libemail-engine
 Libs: -L${privlibdir} -levolution-mail -levolution-mail-composer -levolution-mail-formatter
 Cflags: -I${privincludedir}
diff --git a/evolution-shell.pc.in b/evolution-shell.pc.in
index fbc25d6..0bb224f 100644
--- a/evolution-shell.pc.in
+++ b/evolution-shell.pc.in
@@ -1,15 +1,14 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-libexecdir=@libexecdir@
-includedir=@includedir@
-datarootdir=@datarootdir@
-datadir=@datadir@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+libexecdir=@LIBEXEC_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+datarootdir=@SHARE_INSTALL_DIR@
+datadir=@SHARE_INSTALL_DIR@
 
 privlibdir=@privsolibdir@
 privlibexecdir=@privlibexecdir@
 privincludedir=@privincludedir@
-errordir=@privdatadir@/errors
+errordir=@errordir@
 moduledir=@moduledir@
 imagesdir=@imagesdir@
 
@@ -17,8 +16,8 @@ execversion=@BASE_VERSION@
 
 Name: evolution-shell
 Description: libraries needed for Evolution shell components
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: gtk+-3.0 libebackend-1.2 libedataserver-1.2 libedataserverui-1.2 webkit2gtk-4.0
-Requires.private: @GNOME_DESKTOP_DEPENDENCY@
-Libs: -L${privlibdir} -levolution-shell -levolution-util -Wl,-R${privlibdir}
+@shell_private_requirements@
+Libs: -L${privlibdir} -levolution-shell -levolution-util
 Cflags: -I${privincludedir}
diff --git a/help/CMakeLists.txt b/help/CMakeLists.txt
new file mode 100644
index 0000000..1b61360
--- /dev/null
+++ b/help/CMakeLists.txt
@@ -0,0 +1,330 @@
+set(HELP_ID ${PROJECT_NAME})
+
+set(HELP_FIGURES_DIR figures)
+
+set(HELP_MEDIA
+       ${HELP_FIGURES_DIR}/color-000000.png
+       ${HELP_FIGURES_DIR}/color-204a87.png
+       ${HELP_FIGURES_DIR}/color-2e3436.png
+       ${HELP_FIGURES_DIR}/color-4e9a06.png
+       ${HELP_FIGURES_DIR}/color-5c3566.png
+       ${HELP_FIGURES_DIR}/color-8f5902.png
+       ${HELP_FIGURES_DIR}/color-a40000.png
+       ${HELP_FIGURES_DIR}/color-c4a000.png
+       ${HELP_FIGURES_DIR}/color-ce5c00.png
+       ${HELP_FIGURES_DIR}/evolutionlogo.png
+       ${HELP_FIGURES_DIR}/html-composer-insert-image.png
+       ${HELP_FIGURES_DIR}/html-composer-insert-link.png
+       ${HELP_FIGURES_DIR}/html-composer-insert-rule.png
+       ${HELP_FIGURES_DIR}/html-composer-insert-table.png
+       ${HELP_FIGURES_DIR}/minus-icon.png
+       ${HELP_FIGURES_DIR}/new-mail-notification.png
+       ${HELP_FIGURES_DIR}/new-mail-switcher.png
+       ${HELP_FIGURES_DIR}/plus-icon.png
+       ${HELP_FIGURES_DIR}/search-icon.png
+       ${HELP_FIGURES_DIR}/window-overview-layers.png
+)
+
+set(HELP_FILES
+       backup-restore.page
+       calendar-alarms-and-reminders.page
+       calendar-caldav.page
+       calendar-classifications.page
+       calendar-free-busy.page
+       calendar-google.page
+       calendar-layout-appointment-display.page
+       calendar-layout-general-formatting.page
+       calendar-layout.page
+       calendar-layout-views.page
+       calendar-local.page
+       calendar-marcus-bains-line.page
+       calendar-meetings-delegating.page
+       calendar-meetings.page
+       calendar-meetings-replying-to-invitation.page
+       calendar-meetings-sending-invitation.page
+       calendar-organizing.page
+       calendar-publishing.page
+       calendar-recurrence.page
+       calendar-searching.page
+       calendar-sharing-information.page
+       calendar-timezones.page
+       calendar-usage-add-appointment.page
+       calendar-usage-delete-appointment.page
+       calendar-usage-edit-appointment.page
+       calendar-usage.page
+       calendar-using-several-calendars.page
+       calendar-weather.page
+       calendar-webdav.page
+       change-switcher-appearance.page
+       contacts-add-automatically.page
+       contacts-autocompletion.page
+       contacts-google.page
+       contacts-ldap.page
+       contacts-libreoffice.page
+       contacts-local.page
+       contacts-organizing.page
+       contacts-searching.page
+       contacts-usage-add-contact.page
+       contacts-usage-delete-contact.page
+       contacts-usage-edit-contact.page
+       contacts-usage.page
+       contacts-using-contact-lists.page
+       contacts-using-several-addressbooks.page
+       credits.page
+       data-storage.page
+       default-browser.page
+       deleting-appointments.page
+       deleting-emails.page
+       deleting-to-free-disk-space.page
+       exchange-connectors-overview.page
+       exchange-placeholder.page
+       exporting-data-calendar.page
+       exporting-data-contacts.page
+       exporting-data-mail.page
+       exporting-data.page
+       google-services.page
+       import-apps-mozilla.page
+       import-apps-outlook.page
+       import-data.page
+       import-single-files.page
+       import-supported-file-formats.page
+       index.page
+       intro-application.page
+       intro-first-run.page
+       intro-main-window.page
+       legal.xml
+       mail-access-gmail-imap-account.page
+       mail-access-gmail-pop-account.page
+       mail-account-manage-imap-plus.page
+       mail-account-manage-local-delivery.page
+       mail-account-manage-maildir-format-directories.page
+       mail-account-management.page
+       mail-account-manage-mh-format-directories.page
+       mail-account-manage-microsoft-exchange-evo-ews.page
+       mail-account-manage-microsoft-exchange-evo-mapi.page
+       mail-account-manage-microsoft-exchange.page
+       mail-account-manage-pop.page
+       mail-account-manage-unix-mbox-spool-directory.page
+       mail-account-manage-unix-mbox-spool-file.page
+       mail-account-manage-usenet-news.page
+       mail-attachments.page
+       mail-attachments-received.page
+       mail-attachments-sending.page
+       mail-calendar-sending-invitations.page
+       mail-cannot-see.page
+       mail-change-columns-in-message-list.page
+       mail-change-time-format.page
+       mail-composer-change-quotation-string.page
+       mail-composer-custom-header-lines.page
+       mail-composer-enable-html-format.page
+       mail-composer-external-editor.page
+       mail-composer-forward.page
+       mail-composer-forward-as-attachment.page
+       mail-composer-from-field-override.page
+       mail-composer-html-image.page
+       mail-composer-html-link.page
+       mail-composer-html.page
+       mail-composer-html-rule.page
+       mail-composer-html-table.page
+       mail-composer-html-text.page
+       mail-composer-mail-signatures-manage.page
+       mail-composer-mail-signatures.page
+       mail-composer-mail-signatures-per-account.page
+       mail-composer-message-templates.page
+       mail-composer-message-templates-reply.page
+       mail-composer-message-templates-save.page
+       mail-composer-message-templates-variables.page
+       mail-composer-plain-text.page
+       mail-composer-priority.page
+       mail-composer-reply.page
+       mail-composer-search.page
+       mail-composer-send-account-overrides.page
+       mail-composer-several-recipients.page
+       mail-composer-spellcheck.page
+       mail-composer-write-new-message.page
+       mail-default-CC-and-BCC.page
+       mail-default-folder-locations.page
+       mail-delete-and-undelete.page
+       mail-displaying-character-encodings.page
+       mail-displaying-collapsible-headers.page
+       mail-displaying-images-in-html.page
+       mail-displaying-message.page
+       mail-displaying-sender-photograph.page
+       mail-display-message-source.page
+       mail-duplicates.page
+       mail-encryption-gpg-create-key.page
+       mail-encryption-gpg-decrypting.page
+       mail-encryption-gpg-getting-keys.page
+       mail-encryption-gpg-set-up.page
+       mail-encryption-gpg-signing-encrypting.page
+       mail-encryption.page
+       mail-encryption-s-mime-manage.page
+       mail-encryption-s-mime-signing-encrypting.page
+       mail-filters-actions.page
+       mail-filters-conditions.page
+       mail-filters-not-working.page
+       mail-filters.page
+       mail-folders.page
+       mail-follow-up-flag.page
+       mail-imap-subscriptions.page
+       mail-labels.page
+       mail-layout-changing.page
+       mail-localized-re-subjects.page
+       mail-moving-emails.page
+       mail-not-sent.page
+       mail-organizing.page
+       mail-reading-keyboard-shortcuts.page
+       mail-read-receipts.page
+       mail-received-notification.page
+       mail-receiving-options-exchange-ews.page
+       mail-receiving-options-exchange-mapi.page
+       mail-receiving-options-imap-plus.page
+       mail-receiving-options-local-delivery.page
+       mail-receiving-options-maildir-format-directories.page
+       mail-receiving-options-mh-format-directories.page
+       mail-receiving-options.page
+       mail-receiving-options-pop.page
+       mail-receiving-options-unix-mbox-spool-directory.page
+       mail-receiving-options-unix-mbox-spool-file.page
+       mail-receiving-options-usenet-news.page
+       mail-recognized-thread-related-headers.page
+       mail-refresh-folders.page
+       mail-save-as-pdf.page
+       mail-search-folders-add.page
+       mail-search-folders-conditions.page
+       mail-search-folders-enable.page
+       mail-search-folders.page
+       mail-search-folders-refresh.page
+       mail-searching-attachment-type.page
+       mail-searching.page
+       mail-send-and-receive-automatically.page
+       mail-send-and-receive-manual.page
+       mail-send-and-receive.page
+       mail-sending-options-smtp.page
+       mail-several-pop-accounts.page
+       mail-sorting-message-list.page
+       mail-spam-marking.page
+       mail-spam.page
+       mail-spam-settings.page
+       mail-two-trash-folders.page
+       mail-usenet-subscriptions.page
+       mail-vertical-view.page
+       mail-word-wrap.page
+       mail-working-offline.page
+       memos-searching.page
+       memos-usage-add-memo.page
+       memos-usage-delete-memo.page
+       memos-usage-edit-memo.page
+       memos-usage.page
+       offline.page
+       organizing.page
+       problems-debug-how-to.page
+       problems-getting-help.page
+       problems-reporting-bugs.page
+       searching-items.page
+       sync-with-other-devices.page
+       tasks-caldav.page
+       tasks-display-settings.page
+       tasks-local.page
+       tasks-organizing.page
+       tasks-searching.page
+       tasks-usage-add-task.page
+       tasks-usage-delete-task.page
+       tasks-usage-edit-task.page
+       tasks-usage.page
+       tasks-using-several-tasklists.page
+       tasks-webdav.page
+       using-categories.page
+       xinclude-filter-vfolder-conditions.xml
+       xinclude-mail-account-identity.xml
+       xinclude-searching.xml
+)
+
+add_custom_target(help-files ALL)
+
+macro(create_help_files_for_lang _lang _helpfilesvar)
+       set(pofile "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_lang}.po")
+       set(mofile "${CMAKE_CURRENT_BINARY_DIR}/${dir}/${_lang}.mo")
+
+       if(NOT EXISTS ${pofile})
+               message(FATAL_ERROR "Passed incorrect language '${_lang}' to create_help_files_for_lang()")
+       endif(NOT EXISTS ${pofile})
+
+       set(installed)
+       set(deps)
+       foreach(_file ${HELP_FILES})
+               list(APPEND installed ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/${_file})
+               list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
+               if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+                       list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+               endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+       endforeach(_file)
+       foreach(_file ${HELP_MEDIA})
+               list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
+               if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+                       list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+               endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
+       endforeach(_file)
+
+       add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
+               COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${_lang}"
+               COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o "${mofile}" "${pofile}"
+               COMMAND ${CMAKE_COMMAND} -E env d="${CMAKE_CURRENT_SOURCE_DIR}/C"
+                       itstool -m "${mofile}" ${${_helpfilesvar}} --output 
${CMAKE_CURRENT_BINARY_DIR}/${_lang}/
+               WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/C
+               COMMENT "Generating '${_lang}' help files"
+       )
+
+       add_custom_target(${_lang}-help-files
+               DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
+                       ${pofile}
+                       ${deps}
+       )
+
+       add_dependencies(help-files ${_lang}-help-files)
+
+       install(FILES ${installed}
+               DESTINATION ${SHARE_INSTALL_DIR}/help/${_lang}/${HELP_ID}/
+       )
+endmacro(create_help_files_for_lang)
+
+file(GLOB directories RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
+foreach(dir ${directories})
+       if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
+               list(APPEND helpdeps "${CMAKE_CURRENT_BINARY_DIR}/${dir}/index.page")
+               create_help_files_for_lang(${dir} HELP_FILES)
+
+               foreach(_media ${HELP_MEDIA})
+                       if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
+                               install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}
+                                       DESTINATION 
${SHARE_INSTALL_DIR}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
+                               )
+                       else(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
+                               # Pity, no symlink ability here
+                               install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/C/${_media}
+                                       DESTINATION 
${SHARE_INSTALL_DIR}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
+                               )
+                       endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
+               endforeach(_media)
+       endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
+endforeach(dir)
+
+set(cinstalled)
+foreach(_file ${HELP_FILES})
+       list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
+endforeach(_file)
+
+install(FILES ${cinstalled}
+       DESTINATION ${SHARE_INSTALL_DIR}/help/C/${HELP_ID}/
+)
+
+set(cinstalled)
+foreach(_file ${HELP_MEDIA})
+       list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
+endforeach(_file)
+
+install(FILES ${cinstalled}
+       DESTINATION ${SHARE_INSTALL_DIR}/help/C/${HELP_ID}/${HELP_FIGURES_DIR}
+)
+
+add_subdirectory(quickref)
diff --git a/help/quickref/CMakeLists.txt b/help/quickref/CMakeLists.txt
new file mode 100644
index 0000000..7050575
--- /dev/null
+++ b/help/quickref/CMakeLists.txt
@@ -0,0 +1,9 @@
+file(GLOB directories RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
+
+foreach(dir ${directories})
+       if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/quickref.pdf")
+               install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/quickref.pdf
+                       DESTINATION ${evolutionhelpdir}/quickref/${dir}/
+               )
+       endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/quickref.pdf")
+endforeach(dir)
diff --git a/iconv-detect.c b/iconv-detect.c
index ab0a341..bc7d872 100644
--- a/iconv-detect.c
+++ b/iconv-detect.c
@@ -1,26 +1,25 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
- * This program is free software; you can redistribute it and/or modify it
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published by
  * the Free Software Foundation.
  *
- * This program is distributed in the hope that it will be useful, but
+ * This library 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
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
  * for more details.
  *
  * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- *
- *
- * Authors:
- *             Jeffrey Stedfast <fejj ximian com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
  *
+ * Authors: Jeffrey Stedfast <fejj ximian com>
  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <iconv.h>
 
 enum {
@@ -88,8 +87,37 @@ static CharInfo iso10646_tests[] = {
 
 static int num_iso10646_tests = sizeof (iso10646_tests) / sizeof (CharInfo);
 
+static int
+test_iconv (void)
+{
+       char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
+       char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
+       char *transbuf = malloc (10), *trans = transbuf;
+       iconv_t cd;
+       size_t jp_len = strlen (jp), utf8_len = 10;
+       size_t utf8_real_len = strlen (utf8);
+
+       cd = iconv_open ("UTF-8", "ISO-2022-JP");
+       if (cd == (iconv_t) -1)
+               return 0;
+
+       if (iconv (cd, &jp, &jp_len, &trans, &utf8_len) == -1 || jp_len != 0) {
+               iconv_close (cd);
+               return 0;
+       }
+       if (memcmp (utf8, transbuf, utf8_real_len) != 0) {
+               iconv_close (cd);
+               return 0;
+       }
+
+       iconv_close (cd);
+
+       return 1;
+}
 
-int main (int argc, char **argv)
+int
+main (int argc,
+      char **argv)
 {
        unsigned int iso8859, iso2022, iso10646;
        CharInfo *info;
@@ -97,9 +125,12 @@ int main (int argc, char **argv)
        FILE *fp;
        int i;
 
+       if (!test_iconv ())
+               return 1;
+
        fp = fopen ("iconv-detect.h", "w");
        if (fp == NULL)
-               exit (255);
+               return 255;
 
        fprintf (fp, "/* This is an auto-generated header, DO NOT EDIT! */\n\n");
 
@@ -120,9 +151,6 @@ int main (int argc, char **argv)
        if (iso8859 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-8859-1 formats\n");
                fprintf (fp, "#define ICONV_ISO_D_FORMAT \"%s\"\n", info[0].format);
-#ifdef CONFIGURE_IN
-               exit (1);
-#endif
        } else {
                fprintf (fp, "#define ICONV_ISO_D_FORMAT \"%s\"\n", info[i].format);
        }
@@ -144,9 +172,6 @@ int main (int argc, char **argv)
        if (iso2022 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-2022 formats\n");
                fprintf (fp, "#define ICONV_ISO_S_FORMAT \"%s\"\n", info[0].format);
-#ifdef CONFIGURE_IN
-               exit (3);
-#endif
        } else {
                fprintf (fp, "#define ICONV_ISO_S_FORMAT \"%s\"\n", info[i].format);
        }
@@ -172,14 +197,11 @@ int main (int argc, char **argv)
        if (iso10646 == ISO_UNSUPPORTED) {
                fprintf (stderr, "System doesn't support any ISO-10646-1 formats\n");
                fprintf (fp, "#define ICONV_10646 \"%s\"\n", info[0].charset);
-#ifdef CONFIGURE_IN
-               exit (2);
-#endif
        } else {
                fprintf (fp, "#define ICONV_10646 \"%s\"\n", info[i].charset);
        }
 
        fclose (fp);
 
-       exit (0);
+       return 0;
 }
diff --git a/libemail-engine/CMakeLists.txt b/libemail-engine/CMakeLists.txt
new file mode 100644
index 0000000..864719b
--- /dev/null
+++ b/libemail-engine/CMakeLists.txt
@@ -0,0 +1,94 @@
+glib_mkenums(e-mail-engine-enumtypes e-mail-engine-enums.h E_MAIL_ENGINE_ENUMTYPES_H)
+add_pkgconfig_file(libemail-engine.pc.in libemail-engine.pc)
+
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       camel-null-store.c
+       camel-sasl-oauth2-google.c
+       camel-sasl-xoauth2.c
+       e-mail-folder-utils.c
+       e-mail-junk-filter.c
+       e-mail-session-utils.c
+       e-mail-session.c
+       e-mail-store-utils.c
+       e-mail-utils.c
+       em-filter-folder-element.c
+       em-vfolder-context.c
+       em-vfolder-rule.c
+       mail-config.c
+       mail-folder-cache.c
+       mail-mt.c
+       mail-ops.c
+       mail-tools.c
+       mail-vfolder.c
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-engine-enumtypes.c
+)
+
+set(HEADERS
+       libemail-engine.h
+       camel-null-store.h
+       camel-sasl-oauth2-google.h
+       camel-sasl-xoauth2.h
+       e-mail-engine-enums.h
+       e-mail-folder-utils.h
+       e-mail-junk-filter.h
+       e-mail-session-utils.h
+       e-mail-session.h
+       e-mail-store-utils.h
+       e-mail-utils.h
+       em-filter-folder-element.h
+       em-vfolder-context.h
+       em-vfolder-rule.h
+       mail-config.h
+       mail-folder-cache.h
+       mail-mt.h
+       mail-ops.h
+       mail-tools.h
+       mail-vfolder.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-engine-enumtypes.h
+)
+
+add_library(email-engine SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(email-engine
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(email-engine PRIVATE
+       -DG_LOG_DOMAIN=\"e-mail-engine\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+       -DLIBEMAIL_ENGINE_COMPILATION
+)
+
+target_compile_options(email-engine PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(email-engine PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(email-engine
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS email-engine
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/libemail-engine
+)
diff --git a/libemail-engine/camel-null-store.c b/libemail-engine/camel-null-store.c
index 19d8b19..509c934 100644
--- a/libemail-engine/camel-null-store.c
+++ b/libemail-engine/camel-null-store.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "camel-null-store.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "camel-null-store.h"
+
 G_DEFINE_TYPE (CamelNullStore, camel_null_store, CAMEL_TYPE_STORE)
 
 static CamelProvider null_provider = {
diff --git a/libemail-engine/camel-sasl-oauth2-google.c b/libemail-engine/camel-sasl-oauth2-google.c
index 1275c62..2c89750 100644
--- a/libemail-engine/camel-sasl-oauth2-google.c
+++ b/libemail-engine/camel-sasl-oauth2-google.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/libemail-engine/camel-sasl-xoauth2.c b/libemail-engine/camel-sasl-xoauth2.c
index 2402f0d..ab71197 100644
--- a/libemail-engine/camel-sasl-xoauth2.c
+++ b/libemail-engine/camel-sasl-xoauth2.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include "camel-sasl-xoauth2.h"
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index 0bb12bf..0667962 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-folder-utils.h"
 
@@ -31,7 +29,7 @@
 #include "e-mail-utils.h"
 
 /* X-Mailer header value */
-#define X_MAILER ("Evolution " VERSION SUB_VERSION " " VERSION_COMMENT)
+#define X_MAILER ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
 
 typedef struct _AsyncContext AsyncContext;
 
diff --git a/libemail-engine/e-mail-session-utils.c b/libemail-engine/e-mail-session-utils.c
index eb9f426..20ba4aa 100644
--- a/libemail-engine/e-mail-session-utils.c
+++ b/libemail-engine/e-mail-session-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-session-utils.h"
 
@@ -29,7 +27,7 @@
 #include <libemail-engine/mail-tools.h>
 
 /* X-Mailer header value */
-#define X_MAILER ("Evolution " VERSION SUB_VERSION " " VERSION_COMMENT)
+#define X_MAILER ("Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT)
 
 /* FIXME: Temporary - remove this after we move filter/ to eds */
 #define E_FILTER_SOURCE_OUTGOING "outgoing"
diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c
index 23f1ad8..fc612bc 100644
--- a/libemail-engine/e-mail-session.c
+++ b/libemail-engine/e-mail-session.c
@@ -24,9 +24,7 @@
 
 /* mail-session.c: handles the session information and resource manipulation */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <stdlib.h>
diff --git a/libemail-engine/e-mail-store-utils.c b/libemail-engine/e-mail-store-utils.c
index 34a1a1a..34a4a32 100644
--- a/libemail-engine/e-mail-store-utils.c
+++ b/libemail-engine/e-mail-store-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-folder-utils.h"
 #include "e-mail-utils.h"
diff --git a/libemail-engine/em-filter-folder-element.c b/libemail-engine/em-filter-folder-element.c
index 8a88823..fec0e0b 100644
--- a/libemail-engine/em-filter-folder-element.c
+++ b/libemail-engine/em-filter-folder-element.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-filter-folder-element.h"
 
diff --git a/libemail-engine/em-vfolder-context.c b/libemail-engine/em-vfolder-context.c
index 43ee3f2..3a58c59 100644
--- a/libemail-engine/em-vfolder-context.c
+++ b/libemail-engine/em-vfolder-context.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-vfolder-context.h"
 
diff --git a/libemail-engine/em-vfolder-rule.c b/libemail-engine/em-vfolder-rule.c
index 3a6ffa3..794e209 100644
--- a/libemail-engine/em-vfolder-rule.c
+++ b/libemail-engine/em-vfolder-rule.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/libemail-engine/libemail-engine.pc.in b/libemail-engine/libemail-engine.pc.in
index 9bd2ed0..d607b1b 100644
--- a/libemail-engine/libemail-engine.pc.in
+++ b/libemail-engine/libemail-engine.pc.in
@@ -1,16 +1,15 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-datarootdir=@datarootdir@
-datadir=@datadir@
+prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+datarootdir=@SHARE_INSTALL_DIR@
+datadir=@SHARE_INSTALL_DIR@
 
 privlibdir=@privsolibdir@
 privincludedir=@privincludedir@
 
 Name: libemail-engine
 Description: Client library for evolution mail
-Version: @VERSION@
+Version: @PROJECT_VERSION@
 Requires: gtk+-3.0 camel-1.2 libedataserver-1.2 libebackend-1.2 gio-2.0
 Libs: -L${privlibdir} -lemail-engine
 Cflags: -I${privincludedir}
diff --git a/libemail-engine/mail-config.c b/libemail-engine/mail-config.c
index 68834b9..8834745 100644
--- a/libemail-engine/mail-config.c
+++ b/libemail-engine/mail-config.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index 96093b2..8c8b380 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -27,9 +27,7 @@
  * @short_description: Stores information about open folders
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <string.h>
diff --git a/libemail-engine/mail-mt.c b/libemail-engine/mail-mt.c
index d97f120..a612ff8 100644
--- a/libemail-engine/mail-mt.c
+++ b/libemail-engine/mail-mt.c
@@ -14,9 +14,7 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 5661415..7790e3a 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -24,9 +24,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 
@@ -49,7 +47,7 @@
 #define d(x)
 
 /* XXX Make this a preprocessor definition. */
-const gchar *x_mailer = "Evolution " VERSION SUB_VERSION " " VERSION_COMMENT;
+const gchar *x_mailer = "Evolution " VERSION VERSION_SUBSTRING " " VERSION_COMMENT;
 
 /* used for both just filtering a folder + uid's, and for filtering a whole folder */
 /* used both for fetching mail, and for filtering mail */
diff --git a/libemail-engine/mail-tools.c b/libemail-engine/mail-tools.c
index 061ebb9..5f3334d 100644
--- a/libemail-engine/mail-tools.c
+++ b/libemail-engine/mail-tools.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/libemail-engine/mail-vfolder.c b/libemail-engine/mail-vfolder.c
index 5c8c594..eadd318 100644
--- a/libemail-engine/mail-vfolder.c
+++ b/libemail-engine/mail-vfolder.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "mail-vfolder.h"
 
diff --git a/libgnomecanvas/CMakeLists.txt b/libgnomecanvas/CMakeLists.txt
new file mode 100644
index 0000000..9c58085
--- /dev/null
+++ b/libgnomecanvas/CMakeLists.txt
@@ -0,0 +1,71 @@
+set(SOURCES
+       gailcanvas.c
+       gailcanvasgroup.c
+       gailcanvasgroupfactory.c
+       gailcanvasitem.c
+       gailcanvasitemfactory.c
+       gailcanvastext.c
+       gailcanvastextfactory.c
+       gailcanvaswidget.c
+       gailcanvaswidgetfactory.c
+       gnome-canvas-pixbuf.c
+       gnome-canvas-rect.c
+       gnome-canvas-text.c
+       gnome-canvas-util.c
+       gnome-canvas-widget.c
+       gnome-canvas.c
+)
+
+set(HEADERS
+       gailcanvas.h
+       gailcanvasgroup.h
+       gailcanvasgroupfactory.h
+       gailcanvasitem.h
+       gailcanvasitemfactory.h
+       gailcanvastext.h
+       gailcanvastextfactory.h
+       gailcanvaswidget.h
+       gailcanvaswidgetfactory.h
+       gnome-canvas-i18n.h
+       gnome-canvas-pixbuf.h
+       gnome-canvas-rect.h
+       gnome-canvas-text.h
+       gnome-canvas-util.h
+       gnome-canvas-widget.h
+       gnome-canvas.h
+       libgnomecanvas.h
+)
+
+add_library(gnomecanvas SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+target_compile_definitions(gnomecanvas PRIVATE
+       -DG_LOG_DOMAIN=\"GnomeCanvas\"
+)
+
+target_compile_options(gnomecanvas PUBLIC
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(gnomecanvas PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_CURRENT_SOURCE_DIR}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(gnomecanvas
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${MATH_LDFLAGS}
+)
+
+install(TARGETS gnomecanvas
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/libgnomecanvas
+)
diff --git a/libgnomecanvas/gailcanvas.c b/libgnomecanvas/gailcanvas.c
index 61a9124..6cfd504 100644
--- a/libgnomecanvas/gailcanvas.c
+++ b/libgnomecanvas/gailcanvas.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libgnomecanvas/gnome-canvas.h>
diff --git a/libgnomecanvas/gailcanvasgroup.c b/libgnomecanvas/gailcanvasgroup.c
index e64032c..c478f6e 100644
--- a/libgnomecanvas/gailcanvasgroup.c
+++ b/libgnomecanvas/gailcanvasgroup.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libgnomecanvas/gnome-canvas.h>
diff --git a/libgnomecanvas/gailcanvasgroupfactory.c b/libgnomecanvas/gailcanvasgroupfactory.c
index 0563a8a..fb2a49c 100644
--- a/libgnomecanvas/gailcanvasgroupfactory.c
+++ b/libgnomecanvas/gailcanvasgroupfactory.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include "gailcanvasgroupfactory.h"
diff --git a/libgnomecanvas/gailcanvasitem.c b/libgnomecanvas/gailcanvasitem.c
index 31f38d7..e62bdfd 100644
--- a/libgnomecanvas/gailcanvasitem.c
+++ b/libgnomecanvas/gailcanvasitem.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <gtk/gtk.h>
diff --git a/libgnomecanvas/gailcanvasitemfactory.c b/libgnomecanvas/gailcanvasitemfactory.c
index 28f6811..7104452 100644
--- a/libgnomecanvas/gailcanvasitemfactory.c
+++ b/libgnomecanvas/gailcanvasitemfactory.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include "gailcanvasitemfactory.h"
diff --git a/libgnomecanvas/gailcanvastext.c b/libgnomecanvas/gailcanvastext.c
index 6a658d6..4026bfd 100644
--- a/libgnomecanvas/gailcanvastext.c
+++ b/libgnomecanvas/gailcanvastext.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libgnomecanvas/libgnomecanvas.h>
diff --git a/libgnomecanvas/gailcanvastextfactory.c b/libgnomecanvas/gailcanvastextfactory.c
index fd8ea26..6d0f3bd 100644
--- a/libgnomecanvas/gailcanvastextfactory.c
+++ b/libgnomecanvas/gailcanvastextfactory.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include "gailcanvastextfactory.h"
diff --git a/libgnomecanvas/gailcanvaswidget.c b/libgnomecanvas/gailcanvaswidget.c
index 003b5d3..4ec3efa 100644
--- a/libgnomecanvas/gailcanvaswidget.c
+++ b/libgnomecanvas/gailcanvaswidget.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <libgnomecanvas/gnome-canvas.h>
diff --git a/libgnomecanvas/gailcanvaswidgetfactory.c b/libgnomecanvas/gailcanvaswidgetfactory.c
index fff58aa..27b3ca4 100644
--- a/libgnomecanvas/gailcanvaswidgetfactory.c
+++ b/libgnomecanvas/gailcanvaswidgetfactory.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "gailcanvaswidgetfactory.h"
 #include "gailcanvaswidget.h"
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c
index 87c3c26..796bd86 100644
--- a/libgnomecanvas/gnome-canvas-pixbuf.c
+++ b/libgnomecanvas/gnome-canvas-pixbuf.c
@@ -17,9 +17,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <libgnomecanvas/gnome-canvas.h>
diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c
index eefdb12..a966dd8 100644
--- a/libgnomecanvas/gnome-canvas-rect.c
+++ b/libgnomecanvas/gnome-canvas-rect.c
@@ -18,9 +18,7 @@
 /* These includes are set up for standalone compile. If/when this codebase
  * is integrated into libgnomeui, the includes will need to change. */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <string.h>
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index 5480551..43e6e76 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -32,9 +32,7 @@
  * Port to Pango co-done by Gerg� �rdi <cactus cactus rulez org>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <string.h>
diff --git a/libgnomecanvas/gnome-canvas-util.c b/libgnomecanvas/gnome-canvas-util.c
index 76b2c0a..60e70ff 100644
--- a/libgnomecanvas/gnome-canvas-util.c
+++ b/libgnomecanvas/gnome-canvas-util.c
@@ -29,9 +29,7 @@
  * Author: Federico Mena <federico nuclecu unam mx>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 /* needed for M_PI_2 under 'gcc -ansi -predantic' on GNU/Linux */
 #ifndef _DEFAULT_SOURCE
diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c
index ea31b3a..7593970 100644
--- a/libgnomecanvas/gnome-canvas-widget.c
+++ b/libgnomecanvas/gnome-canvas-widget.c
@@ -29,9 +29,7 @@
  * Author: Federico Mena <federico nuclecu unam mx>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include "gnome-canvas-widget.h"
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index fecce97..6412673 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -74,9 +74,7 @@
  * - Add more image loading techniques to work around imlib deficiencies.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <math.h>
 #include <string.h>
diff --git a/mail/CMakeLists.txt b/mail/CMakeLists.txt
new file mode 100644
index 0000000..d8a552b
--- /dev/null
+++ b/mail/CMakeLists.txt
@@ -0,0 +1,297 @@
+glib_mkenums(e-mail-enumtypes e-mail-enums.h E_MAIL_ENUMTYPES_H)
+add_error_files(mail mail.error)
+add_custom_xml_files(mail ${privdatadir} filter .in ""
+       filtertypes.xml
+       searchtypes.xml
+       vfoldertypes.xml
+)
+
+install(FILES message-list.etspec
+       DESTINATION ${etspecdir}
+)
+
+install(FILES  mail-config.ui
+               mail-dialogs.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       email-engine
+       evolution-mail-composer
+       evolution-mail-formatter
+       evolution-shell
+       evolution-util
+)
+
+if(ENABLE_SMIME)
+       list(APPEND DEPENDENCIES
+               essmime
+               evolution-smime
+       )
+endif(ENABLE_SMIME)
+
+set(SOURCES
+       e-cid-request.c
+       e-http-request.c
+       e-mail-account-manager.c
+       e-mail-account-store.c
+       e-mail-account-tree-view.c
+       e-mail-autoconfig.c
+       e-mail-backend.c
+       e-mail-browser.c
+       e-mail-config-activity-page.c
+       e-mail-config-assistant.c
+       e-mail-config-auth-check.c
+       e-mail-config-confirm-page.c
+       e-mail-config-defaults-page.c
+       e-mail-config-identity-page.c
+       e-mail-config-lookup-page.c
+       e-mail-config-notebook.c
+       e-mail-config-page.c
+       e-mail-config-provider-page.c
+       e-mail-config-receiving-page.c
+       e-mail-config-security-page.c
+       e-mail-config-sending-page.c
+       e-mail-config-service-backend.c
+       e-mail-config-service-notebook.c
+       e-mail-config-service-page.c
+       e-mail-config-sidebar.c
+       e-mail-config-summary-page.c
+       e-mail-config-welcome-page.c
+       e-mail-config-window.c
+       e-mail-display.c
+       e-mail-display-popup-extension.c
+       e-mail-folder-create-dialog.c
+       e-mail-folder-pane.c
+       e-mail-free-form-exp.c
+       e-mail-junk-options.c
+       e-mail-label-action.c
+       e-mail-label-dialog.c
+       e-mail-label-list-store.c
+       e-mail-label-manager.c
+       e-mail-label-tree-view.c
+       e-mail-message-pane.c
+       e-mail-migrate.c
+       e-mail-notes.c
+       e-mail-paned-view.c
+       e-mail-print-config-headers.c
+       e-mail-printer.c
+       e-mail-properties.c
+       e-mail-reader-utils.c
+       e-mail-reader.c
+       e-mail-remote-content.c
+       e-mail-request.c
+       e-mail-send-account-override.c
+       e-mail-sidebar.c
+       e-mail-tag-editor.c
+       e-mail-ui-session.c
+       e-mail-view.c
+       em-composer-utils.c
+       em-config.c
+       em-event.c
+       em-filter-context.c
+       em-filter-editor.c
+       em-filter-editor-folder-element.c
+       em-filter-rule.c
+       em-filter-source-element.c
+       em-folder-properties.c
+       em-folder-selection-button.c
+       em-folder-selector.c
+       em-folder-tree-model.c
+       em-folder-tree.c
+       em-folder-utils.c
+       em-search-context.c
+       em-subscription-editor.c
+       em-utils.c
+       em-vfolder-editor-context.c
+       em-vfolder-editor-rule.c
+       em-vfolder-editor.c
+       mail-autofilter.c
+       mail-send-recv.c
+       mail-vfolder-ui.c
+       message-list.c
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-enumtypes.c
+)
+
+set(HEADERS
+       e-cid-request.h
+       e-http-request.h
+       e-mail.h
+       e-mail-account-manager.h
+       e-mail-account-store.h
+       e-mail-account-tree-view.h
+       e-mail-autoconfig.h
+       e-mail-backend.h
+       e-mail-browser.h
+       e-mail-config-activity-page.h
+       e-mail-config-assistant.h
+       e-mail-config-auth-check.h
+       e-mail-config-confirm-page.h
+       e-mail-config-defaults-page.h
+       e-mail-config-identity-page.h
+       e-mail-config-lookup-page.h
+       e-mail-config-notebook.h
+       e-mail-config-page.h
+       e-mail-config-provider-page.h
+       e-mail-config-receiving-page.h
+       e-mail-config-security-page.h
+       e-mail-config-sending-page.h
+       e-mail-config-service-backend.h
+       e-mail-config-service-notebook.h
+       e-mail-config-service-page.h
+       e-mail-config-sidebar.h
+       e-mail-config-summary-page.h
+       e-mail-config-welcome-page.h
+       e-mail-config-window.h
+       e-mail-display.h
+       e-mail-display-popup-extension.h
+       e-mail-enums.h
+       e-mail-folder-create-dialog.h
+       e-mail-folder-pane.h
+       e-mail-free-form-exp.h
+       e-mail-junk-options.h
+       e-mail-label-action.h
+       e-mail-label-dialog.h
+       e-mail-label-list-store.h
+       e-mail-label-manager.h
+       e-mail-label-tree-view.h
+       e-mail-message-pane.h
+       e-mail-migrate.h
+       e-mail-notes.h
+       e-mail-paned-view.h
+       e-mail-print-config-headers.h
+       e-mail-printer.h
+       e-mail-properties.h
+       e-mail-reader-utils.h
+       e-mail-reader.h
+       e-mail-remote-content.h
+       e-mail-request.h
+       e-mail-send-account-override.h
+       e-mail-sidebar.h
+       e-mail-tag-editor.h
+       e-mail-ui-session.h
+       e-mail-view.h
+       em-composer-utils.h
+       em-config.h
+       em-event.h
+       em-filter-context.h
+       em-filter-editor.h
+       em-filter-editor-folder-element.h
+       em-filter-rule.h
+       em-filter-source-element.h
+       em-folder-properties.h
+       em-folder-selection-button.h
+       em-folder-selector.h
+       em-folder-tree-model.h
+       em-folder-tree.h
+       em-folder-utils.h
+       em-search-context.h
+       em-subscription-editor.h
+       em-utils.h
+       em-vfolder-editor-context.h
+       em-vfolder-editor-rule.h
+       em-vfolder-editor.h
+       mail-autofilter.h
+       mail-send-recv.h
+       mail-vfolder-ui.h
+       message-list.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-mail-enumtypes.h
+)
+
+add_library(evolution-mail SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-mail
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-mail\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+       -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+)
+
+target_compile_options(evolution-mail PUBLIC
+       ${CERT_UI_CFLAGS}
+       ${CANBERRA_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${LIBCRYPTUI_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_BINARY_DIR}/composer
+       ${CMAKE_BINARY_DIR}/em-format
+       ${CMAKE_BINARY_DIR}/shell
+       ${CMAKE_BINARY_DIR}/smime/lib
+       ${CMAKE_BINARY_DIR}/smime/gui
+       ${CMAKE_SOURCE_DIR}/composer
+       ${CMAKE_SOURCE_DIR}/em-format
+       ${CMAKE_SOURCE_DIR}/shell
+       ${CMAKE_SOURCE_DIR}/smime/lib
+       ${CMAKE_SOURCE_DIR}/smime/gui
+       ${CERT_UI_INCLUDE_DIRS}
+       ${CANBERRA_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${LIBCRYPTUI_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail
+       ${DEPENDENCIES}
+       ${CERT_UI_LDFLAGS}
+       ${CANBERRA_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${LIBCRYPTUI_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/mail
+)
+
+# ******************************
+# test-mail-autoconfig
+# ******************************
+
+add_executable(test-mail-autoconfig
+       e-mail-autoconfig.c
+       e-mail-autoconfig.h
+       test-mail-autoconfig.c
+)
+
+target_compile_definitions(test-mail-autoconfig PRIVATE
+       -DG_LOG_DOMAIN=\"test-mail-autoconfig\"
+)
+
+target_compile_options(test-mail-autoconfig PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(test-mail-autoconfig PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(test-mail-autoconfig
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+add_subdirectory(default)
+add_subdirectory(importers)
diff --git a/mail/default/CMakeLists.txt b/mail/default/CMakeLists.txt
new file mode 100644
index 0000000..1549f2a
--- /dev/null
+++ b/mail/default/CMakeLists.txt
@@ -0,0 +1,9 @@
+file(GLOB directories RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
+
+foreach(dir ${directories})
+       if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/Inbox")
+               install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/Inbox
+                       DESTINATION ${privdatadir}/default/${dir}/mail/local
+               )
+       endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/Inbox")
+endforeach(dir)
diff --git a/mail/e-cid-request.c b/mail/e-cid-request.c
index e7529f7..69fd326 100644
--- a/mail/e-cid-request.c
+++ b/mail/e-cid-request.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/mail/e-http-request.c b/mail/e-http-request.c
index 9e7711b..f956c80 100644
--- a/mail/e-http-request.c
+++ b/mail/e-http-request.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/mail/e-mail-account-manager.c b/mail/e-mail-account-manager.c
index 48ca8e6..06488b4 100644
--- a/mail/e-mail-account-manager.c
+++ b/mail/e-mail-account-manager.c
@@ -15,16 +15,17 @@
  *
  */
 
-#include "e-mail-account-manager.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 #include <gdk/gdkkeysyms.h>
 
 #include <e-util/e-util.h>
 #include <libemail-engine/libemail-engine.h>
 
-#include <mail/e-mail-account-tree-view.h>
+#include "e-mail-account-tree-view.h"
+
+#include "e-mail-account-manager.h"
 
 #define E_MAIL_ACCOUNT_MANAGER_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c
index 8fd06e8..ea84c87 100644
--- a/mail/e-mail-account-store.c
+++ b/mail/e-mail-account-store.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-account-store.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
 
@@ -25,7 +24,9 @@
 
 #include <libemail-engine/libemail-engine.h>
 
-#include <mail/mail-vfolder-ui.h>
+#include "mail-vfolder-ui.h"
+
+#include "e-mail-account-store.h"
 
 #define E_MAIL_ACCOUNT_STORE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-account-tree-view.c b/mail/e-mail-account-tree-view.c
index c7c824e..ea313f0 100644
--- a/mail/e-mail-account-tree-view.c
+++ b/mail/e-mail-account-tree-view.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-account-tree-view.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-account-tree-view.h"
+
 #define E_MAIL_ACCOUNT_TREE_VIEW_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_ACCOUNT_TREE_VIEW, EMailAccountTreeViewPrivate))
diff --git a/mail/e-mail-autoconfig.c b/mail/e-mail-autoconfig.c
index c7cc0b3..bfd2fc4 100644
--- a/mail/e-mail-autoconfig.c
+++ b/mail/e-mail-autoconfig.c
@@ -61,15 +61,16 @@
  * Recording my thoughts here for posterity. -- mbarnes
  */
 
-#include "e-mail-autoconfig.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
 /* For error codes. */
 #include <libsoup/soup.h>
 
+#include "e-mail-autoconfig.h"
+
 #define E_MAIL_AUTOCONFIG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_AUTOCONFIG, EMailAutoconfigPrivate))
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index 3483017..9e76425 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-backend.h"
 
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c
index 2186a72..5809256 100644
--- a/mail/e-mail-browser.c
+++ b/mail/e-mail-browser.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-browser.h"
 
diff --git a/mail/e-mail-config-assistant.c b/mail/e-mail-config-assistant.c
index 3363c21..6240bdc 100644
--- a/mail/e-mail-config-assistant.c
+++ b/mail/e-mail-config-assistant.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-config-assistant.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
@@ -27,17 +26,19 @@
 #include <shell/e-shell-view.h>
 #include <shell/e-shell-sidebar.h>
 
-#include <mail/e-mail-config-confirm-page.h>
-#include <mail/e-mail-config-identity-page.h>
-#include <mail/e-mail-config-lookup-page.h>
-#include <mail/e-mail-config-provider-page.h>
-#include <mail/e-mail-config-receiving-page.h>
-#include <mail/e-mail-config-sending-page.h>
-#include <mail/e-mail-config-summary-page.h>
-#include <mail/e-mail-config-welcome-page.h>
+#include "e-mail-config-confirm-page.h"
+#include "e-mail-config-identity-page.h"
+#include "e-mail-config-lookup-page.h"
+#include "e-mail-config-provider-page.h"
+#include "e-mail-config-receiving-page.h"
+#include "e-mail-config-sending-page.h"
+#include "e-mail-config-summary-page.h"
+#include "e-mail-config-welcome-page.h"
 
 #include "em-folder-tree.h"
 
+#include "e-mail-config-assistant.h"
+
 #define E_MAIL_CONFIG_ASSISTANT_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_ASSISTANT, EMailConfigAssistantPrivate))
diff --git a/mail/e-mail-config-auth-check.c b/mail/e-mail-config-auth-check.c
index eb7adc8..3284fb8 100644
--- a/mail/e-mail-config-auth-check.c
+++ b/mail/e-mail-config-auth-check.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include "e-util/e-util.h"
diff --git a/mail/e-mail-config-confirm-page.c b/mail/e-mail-config-confirm-page.c
index 1882f0f..d943001 100644
--- a/mail/e-mail-config-confirm-page.c
+++ b/mail/e-mail-config-confirm-page.c
@@ -15,13 +15,14 @@
  *
  */
 
-#include "e-mail-config-confirm-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
 
+#include "e-mail-config-confirm-page.h"
+
 #define E_MAIL_CONFIG_CONFIRM_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_CONFIRM_PAGE, EMailConfigConfirmPagePrivate))
diff --git a/mail/e-mail-config-defaults-page.c b/mail/e-mail-config-defaults-page.c
index bf1399d..ed33f85 100644
--- a/mail/e-mail-config-defaults-page.c
+++ b/mail/e-mail-config-defaults-page.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/mail/e-mail-config-identity-page.c b/mail/e-mail-config-identity-page.c
index 5baa5f5..7c60091 100644
--- a/mail/e-mail-config-identity-page.c
+++ b/mail/e-mail-config-identity-page.c
@@ -15,14 +15,14 @@
  *
  */
 
-#include "e-mail-config-identity-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
 
 #include "e-util/e-util.h"
+#include "e-mail-config-identity-page.h"
 
 #define E_MAIL_CONFIG_IDENTITY_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-config-lookup-page.c b/mail/e-mail-config-lookup-page.c
index 22cbf51..9c0c21a 100644
--- a/mail/e-mail-config-lookup-page.c
+++ b/mail/e-mail-config-lookup-page.c
@@ -14,9 +14,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  *
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/mail/e-mail-config-page.c b/mail/e-mail-config-page.c
index 05d87f5..c9795aa 100644
--- a/mail/e-mail-config-page.c
+++ b/mail/e-mail-config-page.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-config-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libedataserver/libedataserver.h>
@@ -25,6 +24,8 @@
 #include <e-util/e-marshal.h>
 #include <e-util/e-util.h>
 
+#include "e-mail-config-page.h"
+
 enum {
        CHANGED,
        SETUP_DEFAULTS,
diff --git a/mail/e-mail-config-provider-page.c b/mail/e-mail-config-provider-page.c
index 46858ae..4b82c73 100644
--- a/mail/e-mail-config-provider-page.c
+++ b/mail/e-mail-config-provider-page.c
@@ -15,14 +15,15 @@
  *
  */
 
-#include "e-mail-config-provider-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
 
+#include "e-mail-config-provider-page.h"
+
 #define E_MAIL_CONFIG_PROVIDER_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_PROVIDER_PAGE, EMailConfigProviderPagePrivate))
diff --git a/mail/e-mail-config-receiving-page.c b/mail/e-mail-config-receiving-page.c
index b289ef8..a2be696 100644
--- a/mail/e-mail-config-receiving-page.c
+++ b/mail/e-mail-config-receiving-page.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-config-receiving-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-config-receiving-page.h"
+
 /* Forward Declarations */
 static void    e_mail_config_receiving_page_interface_init
                                        (EMailConfigPageInterface *iface);
diff --git a/mail/e-mail-config-security-page.c b/mail/e-mail-config-security-page.c
index 441159f..95f666d 100644
--- a/mail/e-mail-config-security-page.c
+++ b/mail/e-mail-config-security-page.c
@@ -15,17 +15,16 @@
  *
  */
 
-#include "e-mail-config-security-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <e-util/e-util.h>
 #include <libebackend/libebackend.h>
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
 #include <smime/gui/e-cert-selector.h>
-#endif /* HAVE_NSS */
+#endif /* ENABLE_SMIME */
 
 #ifdef HAVE_LIBCRYPTUI
 #define LIBCRYPTUI_API_SUBJECT_TO_CHANGE
@@ -33,6 +32,8 @@
 #undef LIBCRYPTUI_API_SUBJECT_TO_CHANGE
 #endif /* HAVE_LIBCRYPTUI */
 
+#include "e-mail-config-security-page.h"
+
 #define E_MAIL_CONFIG_SECURITY_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_SECURITY_PAGE, EMailConfigSecurityPagePrivate))
@@ -298,9 +299,9 @@ mail_config_security_page_constructed (GObject *object)
        const gchar *text;
        gchar *markup;
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
        ESourceSMIME *smime_ext;
-#endif /* HAVE_NSS */
+#endif /* ENABLE_SMIME */
 
        page = E_MAIL_CONFIG_SECURITY_PAGE (object);
 
@@ -315,10 +316,10 @@ mail_config_security_page_constructed (GObject *object)
        extension_name = E_SOURCE_EXTENSION_OPENPGP;
        openpgp_ext = e_source_get_extension (source, extension_name);
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
        extension_name = E_SOURCE_EXTENSION_SMIME;
        smime_ext = e_source_get_extension (source, extension_name);
-#endif /* HAVE_NSS */
+#endif /* ENABLE_SMIME */
 
        gtk_orientable_set_orientation (
                GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
@@ -511,7 +512,7 @@ mail_config_security_page_constructed (GObject *object)
                G_BINDING_SYNC_CREATE |
                G_BINDING_BIDIRECTIONAL);
 
-#if defined (HAVE_NSS)
+#if defined (ENABLE_SMIME)
 
        /*** Security MIME (S/MIME) ***/
 
@@ -720,7 +721,7 @@ mail_config_security_page_constructed (GObject *object)
                NULL,
                NULL, (GDestroyNotify) NULL);
 
-#endif /* HAVE_NSS */
+#endif /* ENABLE_SMIME */
 
        g_object_unref (size_group);
 
diff --git a/mail/e-mail-config-sending-page.c b/mail/e-mail-config-sending-page.c
index 56d39de..17c8374 100644
--- a/mail/e-mail-config-sending-page.c
+++ b/mail/e-mail-config-sending-page.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-config-sending-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-config-sending-page.h"
+
 /* Forward Declarations */
 static void    e_mail_config_sending_page_interface_init
                                        (EMailConfigPageInterface *iface);
diff --git a/mail/e-mail-config-service-page.c b/mail/e-mail-config-service-page.c
index d7747a5..a3ed3ae 100644
--- a/mail/e-mail-config-service-page.c
+++ b/mail/e-mail-config-service-page.c
@@ -15,16 +15,17 @@
  *
  */
 
-#include "e-mail-config-service-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
 #include <libebackend/libebackend.h>
 
-#include <mail/e-mail-config-page.h>
-#include <mail/e-mail-config-service-notebook.h>
+#include "e-mail-config-page.h"
+#include "e-mail-config-service-notebook.h"
+
+#include "e-mail-config-service-page.h"
 
 #define E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-config-summary-page.c b/mail/e-mail-config-summary-page.c
index 417187b..5c692ca 100644
--- a/mail/e-mail-config-summary-page.c
+++ b/mail/e-mail-config-summary-page.c
@@ -15,15 +15,16 @@
  *
  */
 
-#include "e-mail-config-summary-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
 #include <libebackend/libebackend.h>
 #include <e-util/e-util.h>
 
+#include "e-mail-config-summary-page.h"
+
 #define E_MAIL_CONFIG_SUMMARY_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_SUMMARY_PAGE, EMailConfigSummaryPagePrivate))
diff --git a/mail/e-mail-config-welcome-page.c b/mail/e-mail-config-welcome-page.c
index edb249a..fdf13cc 100644
--- a/mail/e-mail-config-welcome-page.c
+++ b/mail/e-mail-config-welcome-page.c
@@ -15,14 +15,15 @@
  *
  */
 
-#include "e-mail-config-welcome-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <e-util/e-util.h>
 #include <libebackend/libebackend.h>
 
+#include "e-mail-config-welcome-page.h"
+
 #define E_MAIL_CONFIG_WELCOME_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_WELCOME_PAGE, EMailConfigWelcomePagePrivate))
diff --git a/mail/e-mail-config-window.c b/mail/e-mail-config-window.c
index db92465..5727ea2 100644
--- a/mail/e-mail-config-window.c
+++ b/mail/e-mail-config-window.c
@@ -15,15 +15,16 @@
  *
  */
 
-#include "e-mail-config-window.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "e-util/e-util.h"
 
-#include "mail/e-mail-config-notebook.h"
-#include "mail/e-mail-config-sidebar.h"
+#include "e-mail-config-notebook.h"
+#include "e-mail-config-sidebar.h"
+
+#include "e-mail-config-window.h"
 
 #define E_MAIL_CONFIG_WINDOW_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 5fc90f7..f26a188 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -18,9 +18,8 @@
  *
  */
 
-#include "e-mail-display.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 
@@ -43,7 +42,9 @@
 #include "em-composer-utils.h"
 #include "em-utils.h"
 
-#include <web-extensions/e-web-extension-names.h>
+#include "web-extensions/e-web-extension-names.h"
+
+#include "e-mail-display.h"
 
 #define d(x)
 
diff --git a/mail/e-mail-folder-create-dialog.c b/mail/e-mail-folder-create-dialog.c
index 0192614..9d32b54 100644
--- a/mail/e-mail-folder-create-dialog.c
+++ b/mail/e-mail-folder-create-dialog.c
@@ -15,14 +15,15 @@
  *
  */
 
-#include "e-mail-folder-create-dialog.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include "em-vfolder-editor-rule.h"
 #include "mail-vfolder-ui.h"
 
+#include "e-mail-folder-create-dialog.h"
+
 #define E_MAIL_FOLDER_CREATE_DIALOG_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_FOLDER_CREATE_DIALOG, EMailFolderCreateDialogPrivate))
diff --git a/mail/e-mail-folder-pane.c b/mail/e-mail-folder-pane.c
index 8a6c7bd..1c689a7 100644
--- a/mail/e-mail-folder-pane.c
+++ b/mail/e-mail-folder-pane.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-folder-pane.h"
 
diff --git a/mail/e-mail-free-form-exp.c b/mail/e-mail-free-form-exp.c
index 39af793..62af45a 100644
--- a/mail/e-mail-free-form-exp.c
+++ b/mail/e-mail-free-form-exp.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <glib/gi18n-lib.h>
diff --git a/mail/e-mail-junk-options.c b/mail/e-mail-junk-options.c
index 975bd36..4397556 100644
--- a/mail/e-mail-junk-options.c
+++ b/mail/e-mail-junk-options.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-junk-options.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-junk-options.h"
+
 #define E_MAIL_JUNK_OPTIONS_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_JUNK_OPTIONS, EMailJunkOptionsPrivate))
diff --git a/mail/e-mail-label-action.c b/mail/e-mail-label-action.c
index 9aceb39..dceb585 100644
--- a/mail/e-mail-label-action.c
+++ b/mail/e-mail-label-action.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libedataserver/libedataserver.h>
 
diff --git a/mail/e-mail-label-dialog.c b/mail/e-mail-label-dialog.c
index eb02461..43aa5be 100644
--- a/mail/e-mail-label-dialog.c
+++ b/mail/e-mail-label-dialog.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-label-dialog.h"
 
diff --git a/mail/e-mail-label-list-store.c b/mail/e-mail-label-list-store.c
index 774495a..991bac7 100644
--- a/mail/e-mail-label-list-store.c
+++ b/mail/e-mail-label-list-store.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-label-list-store.h"
 
diff --git a/mail/e-mail-label-manager.c b/mail/e-mail-label-manager.c
index ac0e0d3..d0d86aa 100644
--- a/mail/e-mail-label-manager.c
+++ b/mail/e-mail-label-manager.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-label-manager.h"
 
diff --git a/mail/e-mail-label-tree-view.c b/mail/e-mail-label-tree-view.c
index 16a4fba..ab2ec60 100644
--- a/mail/e-mail-label-tree-view.c
+++ b/mail/e-mail-label-tree-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-label-tree-view.h"
 
diff --git a/mail/e-mail-message-pane.c b/mail/e-mail-message-pane.c
index 0249d82..d5f49ab 100644
--- a/mail/e-mail-message-pane.c
+++ b/mail/e-mail-message-pane.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-message-pane.h"
 
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index 1ff2f6b..50fdf2b 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-migrate.h"
 
diff --git a/mail/e-mail-notes.c b/mail/e-mail-notes.c
index 94a8396..a917360 100644
--- a/mail/e-mail-notes.c
+++ b/mail/e-mail-notes.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdio.h>
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index cf5635e..b038fe2 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "e-mail-paned-view.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n.h>
 
 #include <shell/e-shell-window-actions.h>
@@ -32,6 +31,8 @@
 #include "message-list.h"
 #include "e-mail-reader-utils.h"
 
+#include "e-mail-paned-view.h"
+
 #define E_MAIL_PANED_VIEW_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_PANED_VIEW, EMailPanedViewPrivate))
diff --git a/mail/e-mail-print-config-headers.c b/mail/e-mail-print-config-headers.c
index e58b3e0..9b5bfbd 100644
--- a/mail/e-mail-print-config-headers.c
+++ b/mail/e-mail-print-config-headers.c
@@ -15,13 +15,14 @@
  *
  */
 
-#include "e-mail-print-config-headers.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <em-format/e-mail-formatter-print.h>
 
+#include "e-mail-print-config-headers.h"
+
 #define E_MAIL_PRINT_CONFIG_HEADERS_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_PRINT_CONFIG_HEADERS, EMailPrintConfigHeadersPrivate))
diff --git a/mail/e-mail-printer.c b/mail/e-mail-printer.c
index e49f8cd..346407a 100644
--- a/mail/e-mail-printer.c
+++ b/mail/e-mail-printer.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/mail/e-mail-properties.c b/mail/e-mail-properties.c
index 47a8e8c..588eff7 100644
--- a/mail/e-mail-properties.c
+++ b/mail/e-mail-properties.c
@@ -15,9 +15,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index b23d51d..8221cc4 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -20,9 +20,7 @@
 
 /* Miscellaneous utility functions used by EMailReader actions. */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-reader-utils.h"
 
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 8fe32f4..be23984 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-reader.h"
 
diff --git a/mail/e-mail-remote-content.c b/mail/e-mail-remote-content.c
index 57ae1af..f38d541 100644
--- a/mail/e-mail-remote-content.c
+++ b/mail/e-mail-remote-content.c
@@ -15,9 +15,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index a5ef505..ba350d6 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libsoup/soup.h>
 
diff --git a/mail/e-mail-send-account-override.c b/mail/e-mail-send-account-override.c
index db407de..ad73f72 100644
--- a/mail/e-mail-send-account-override.c
+++ b/mail/e-mail-send-account-override.c
@@ -18,13 +18,14 @@
  *
  */
 
-#include "e-mail-send-account-override.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <libedataserver/libedataserver.h>
 
+#include "e-mail-send-account-override.h"
+
 #define E_MAIL_SEND_ACCOUNT_OVERRIDE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_SEND_ACCOUNT_OVERRIDE, EMailSendAccountOverridePrivate))
diff --git a/mail/e-mail-sidebar.c b/mail/e-mail-sidebar.c
index cf6a20c..2d4f717 100644
--- a/mail/e-mail-sidebar.c
+++ b/mail/e-mail-sidebar.c
@@ -18,13 +18,14 @@
  *
  */
 
-#include "e-mail-sidebar.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <camel/camel.h>
 
-#include "mail/em-utils.h"
+#include "em-utils.h"
+
+#include "e-mail-sidebar.h"
 
 #define E_MAIL_SIDEBAR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/e-mail-tag-editor.c b/mail/e-mail-tag-editor.c
index 7414d7e..2602241 100644
--- a/mail/e-mail-tag-editor.c
+++ b/mail/e-mail-tag-editor.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-tag-editor.h"
 
diff --git a/mail/e-mail-ui-session.c b/mail/e-mail-ui-session.c
index fd62835..9fcc2e8 100644
--- a/mail/e-mail-ui-session.c
+++ b/mail/e-mail-ui-session.c
@@ -24,9 +24,7 @@
 
 /* mail-session.c: handles the session information and resource manipulation */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <stdlib.h>
diff --git a/mail/e-mail-view.c b/mail/e-mail-view.c
index f970be8..a9a752f 100644
--- a/mail/e-mail-view.c
+++ b/mail/e-mail-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-view.h"
 
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 5eb1cd9..8b9334a 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/mail/em-config.c b/mail/em-config.c
index ed65b60..eeffd6d 100644
--- a/mail/em-config.c
+++ b/mail/em-config.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/mail/em-event.c b/mail/em-event.c
index 34095f1..9beef05 100644
--- a/mail/em-event.c
+++ b/mail/em-event.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c
index 59485a9..da33df6 100644
--- a/mail/em-filter-context.c
+++ b/mail/em-filter-context.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/mail/em-filter-editor-folder-element.c b/mail/em-filter-editor-folder-element.c
index 28bcc9d..246210c 100644
--- a/mail/em-filter-editor-folder-element.c
+++ b/mail/em-filter-editor-folder-element.c
@@ -21,18 +21,19 @@
  *
  */
 
-#include "em-filter-editor-folder-element.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
-#include "mail/em-folder-selection-button.h"
-#include "mail/em-utils.h"
+#include "em-folder-selection-button.h"
+#include "em-utils.h"
 #include "shell/e-shell.h"
 
+#include "em-filter-editor-folder-element.h"
+
 #define EM_FILTER_EDITOR_FOLDER_ELEMENT_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EM_TYPE_FILTER_EDITOR_FOLDER_ELEMENT, EMFilterEditorFolderElementPrivate))
diff --git a/mail/em-filter-editor.c b/mail/em-filter-editor.c
index f4e0d27..e20983b 100644
--- a/mail/em-filter-editor.c
+++ b/mail/em-filter-editor.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c
index cb80e1f..75df5a1 100644
--- a/mail/em-filter-rule.c
+++ b/mail/em-filter-rule.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/mail/em-filter-source-element.c b/mail/em-filter-source-element.c
index 21328ea..dc32d53 100644
--- a/mail/em-filter-source-element.c
+++ b/mail/em-filter-source-element.c
@@ -20,9 +20,8 @@
  *
  */
 
-#include "em-filter-source-element.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <gtk/gtk.h>
@@ -33,6 +32,8 @@
 #include "e-mail-account-store.h"
 #include "e-mail-ui-session.h"
 
+#include "em-filter-source-element.h"
+
 #define EM_FILTER_SOURCE_ELEMENT_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EM_TYPE_FILTER_SOURCE_ELEMENT, EMFilterSourceElementPrivate))
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 09ac395..d267b05 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-folder-properties.h"
 
diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c
index b43eb3e..4119f24 100644
--- a/mail/em-folder-selection-button.c
+++ b/mail/em-folder-selection-button.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "em-folder-selection-button.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n.h>
 #include <e-util/e-util.h>
@@ -32,6 +31,8 @@
 #include "em-folder-selector.h"
 #include "em-utils.h"
 
+#include "em-folder-selection-button.h"
+
 #define EM_FOLDER_SELECTION_BUTTON_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EM_TYPE_FOLDER_SELECTION_BUTTON, EMFolderSelectionButtonPrivate))
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index 6f78e35..67cac64 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -20,9 +20,8 @@
  *
  */
 
-#include "em-folder-selector.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
@@ -34,6 +33,8 @@
 #include "em-folder-utils.h"
 #include "em-utils.h"
 
+#include "em-folder-selector.h"
+
 #define d(x)
 
 #define EM_FOLDER_SELECTOR_GET_PRIVATE(obj) \
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 37480d9..2d76046 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "em-folder-tree-model.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -41,6 +40,8 @@
 #include "em-folder-utils.h"
 #include "em-event.h"
 
+#include "em-folder-tree-model.h"
+
 #define EM_FOLDER_TREE_MODEL_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EM_TYPE_FOLDER_TREE_MODEL, EMFolderTreeModelPrivate))
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index ce5ab9f..42d3e56 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "em-folder-tree.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -48,6 +47,8 @@
 
 #include "e-mail-ui-session.h"
 
+#include "em-folder-tree.h"
+
 #define d(x)
 
 #define EM_FOLDER_TREE_GET_PRIVATE(obj) \
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 479d878..2f52d4a 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "em-folder-utils.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -49,6 +48,8 @@
 #include "em-folder-properties.h"
 #include "mail-vfolder-ui.h"
 
+#include "em-folder-utils.h"
+
 #define d(x)
 
 static gboolean
diff --git a/mail/em-search-context.c b/mail/em-search-context.c
index e990784..8e9dec9 100644
--- a/mail/em-search-context.c
+++ b/mail/em-search-context.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-search-context.h"
 
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index 934b24e..c7027b0 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -15,15 +15,15 @@
  *
  */
 
-#include "em-subscription-editor.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
 #include <e-util/e-util.h>
 
 #include "em-folder-utils.h"
+#include "em-subscription-editor.h"
 
 #define EM_SUBSCRIPTION_EDITOR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/mail/em-utils.c b/mail/em-utils.c
index c287030..1b55f48 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "em-utils.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
@@ -52,6 +51,8 @@
 #include "em-filter-editor.h"
 #include "em-folder-properties.h"
 
+#include "em-utils.h"
+
 /* How many is too many? */
 /* Used in em_util_ask_open_many() */
 #define TOO_MANY 10
diff --git a/mail/em-vfolder-editor-context.c b/mail/em-vfolder-editor-context.c
index e1fc3bb..c3e8e61 100644
--- a/mail/em-vfolder-editor-context.c
+++ b/mail/em-vfolder-editor-context.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-vfolder-editor-context.h"
 
diff --git a/mail/em-vfolder-editor-rule.c b/mail/em-vfolder-editor-rule.c
index 541ec34..8385c4c 100644
--- a/mail/em-vfolder-editor-rule.c
+++ b/mail/em-vfolder-editor-rule.c
@@ -20,9 +20,8 @@
  *
  */
 
-#include "em-vfolder-editor-rule.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 
 #include <gtk/gtk.h>
@@ -38,6 +37,8 @@
 #include "em-utils.h"
 #include "em-vfolder-editor-context.h"
 
+#include "em-vfolder-editor-rule.h"
+
 #define EM_VFOLDER_EDITOR_RULE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), EM_TYPE_VFOLDER_EDITOR_RULE, EMVFolderEditorRulePrivate))
diff --git a/mail/em-vfolder-editor.c b/mail/em-vfolder-editor.c
index c026f4a..7809828 100644
--- a/mail/em-vfolder-editor.c
+++ b/mail/em-vfolder-editor.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/mail/importers/CMakeLists.txt b/mail/importers/CMakeLists.txt
new file mode 100644
index 0000000..360ca0b
--- /dev/null
+++ b/mail/importers/CMakeLists.txt
@@ -0,0 +1,56 @@
+set(DEPENDENCIES
+       email-engine
+       evolution-mail
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       kmail-libs.c
+       kmail-libs.h
+       kmail-importer.c
+       mail-importer.c
+       mail-importer.h
+       elm-importer.c
+       pine-importer.c
+       evolution-mbox-importer.c
+)
+
+add_library(evolution-mail-importers SHARED
+       ${SOURCES}
+)
+
+add_dependencies(evolution-mail-importers
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-mail-importers PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-mail-importers\"
+       -DEVOLUTION_PRIVDATADIR=\"${privdatadir}\"
+       -DEVOLUTION_ETSPECDIR=\"${etspecdir}\"
+)
+
+target_compile_options(evolution-mail-importers PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-mail-importers PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_BINARY_DIR}/mail
+       ${CMAKE_SOURCE_DIR}/mail
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-mail-importers
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-mail-importers
+       DESTINATION ${privsolibdir}
+)
diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c
index 454cab4..a53f4f2 100644
--- a/mail/importers/elm-importer.c
+++ b/mail/importers/elm-importer.c
@@ -20,7 +20,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <stdio.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c
index 6a9ba05..2324ce8 100644
--- a/mail/importers/evolution-mbox-importer.c
+++ b/mail/importers/evolution-mbox-importer.c
@@ -20,7 +20,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/mail/importers/kmail-importer.c b/mail/importers/kmail-importer.c
index f454c45..307d20e 100644
--- a/mail/importers/kmail-importer.c
+++ b/mail/importers/kmail-importer.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/mail/importers/kmail-libs.c b/mail/importers/kmail-libs.c
index 6079541..bc93b64 100644
--- a/mail/importers/kmail-libs.c
+++ b/mail/importers/kmail-libs.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c
index cb88c1d..0c02121 100644
--- a/mail/importers/mail-importer.c
+++ b/mail/importers/mail-importer.c
@@ -20,10 +20,8 @@
  *
  */
 
-#include "mail-importer.h"
-#include "kmail-libs.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/types.h>
@@ -37,6 +35,9 @@
 #include "e-util/e-util-private.h"
 #include "shell/e-shell-backend.h"
 
+#include "mail-importer.h"
+#include "kmail-libs.h"
+
 struct _import_mbox_msg {
        MailMsg base;
 
diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c
index 074ac3b..9397693 100644
--- a/mail/importers/pine-importer.c
+++ b/mail/importers/pine-importer.c
@@ -20,7 +20,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <stdio.h>
 #include <errno.h>
 #include <sys/types.h>
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index 92dd32a..46e517a 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -20,7 +20,8 @@
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <ctype.h>
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 08b0d1e..b968335 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "mail-send-recv.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <glib/gi18n.h>
@@ -38,6 +37,8 @@
 #include "em-filter-rule.h"
 #include "em-utils.h"
 
+#include "mail-send-recv.h"
+
 #define d(x)
 
 /* ms between status updates to the gui */
diff --git a/mail/mail-vfolder-ui.c b/mail/mail-vfolder-ui.c
index 7ada540..5767bce 100644
--- a/mail/mail-vfolder-ui.c
+++ b/mail/mail-vfolder-ui.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "mail-vfolder-ui.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <string.h>
 #include <glib/gi18n.h>
 
@@ -36,6 +35,8 @@
 #include "mail-autofilter.h"
 #include "e-mail-ui-session.h"
 
+#include "mail-vfolder-ui.h"
+
 #define d(x)  /* (printf("%s:%s: ",  G_STRLOC, G_STRFUNC), (x))*/
 
 /* NOTE: Once mail is moved to EDS, this context needs to be created ofr Mail UI. */
diff --git a/mail/message-list.c b/mail/message-list.c
index 227bc8f..58890b5 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -21,9 +21,8 @@
  *
  */
 
-#include "message-list.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
@@ -58,6 +57,8 @@
 #define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
 #endif
 
+#include "message-list.h"
+
 #define d(x)
 #define t(x)
 
diff --git a/mail/test-mail-autoconfig.c b/mail/test-mail-autoconfig.c
index 2dd5491..6e7ad4e 100644
--- a/mail/test-mail-autoconfig.c
+++ b/mail/test-mail-autoconfig.c
@@ -15,6 +15,8 @@
  *
  */
 
+#include "evolution-config.h"
+
 #include <stdlib.h>
 #include <libedataserver/libedataserver.h>
 
diff --git a/maint/CMakeLists.txt b/maint/CMakeLists.txt
new file mode 100644
index 0000000..6d3dd32
--- /dev/null
+++ b/maint/CMakeLists.txt
@@ -0,0 +1,52 @@
+pkg_check_variable(glade_prefix gladeui-2.0 prefix)
+pkg_check_variable(glade_catalogdir gladeui-2.0 catalogdir)
+pkg_check_variable(glade_moduledir gladeui-2.0 moduledir)
+
+# To honor configured prefix, but still use the right place
+string(REPLACE "${glade_prefix}" "${CMAKE_INSTALL_PREFIX}" glade_catalogdir "${glade_catalogdir}")
+string(REPLACE "${glade_prefix}" "${CMAKE_INSTALL_PREFIX}" glade_moduledir "${glade_moduledir}")
+
+install(FILES evolution.xml
+       DESTINATION ${glade_catalogdir}
+)
+
+set(DEPENDENCIES
+       evolution-calendar
+       evolution-mail
+       evolution-util
+)
+
+add_library(gladeevolution MODULE
+       gladeevolution.c
+)
+
+add_dependencies(gladeevolution
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(gladeevolution PRIVATE
+       -DG_LOG_DOMAIN=\"gladeevolution\"
+)
+
+target_compile_options(gladeevolution PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(gladeevolution PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(gladeevolution
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS gladeevolution
+       DESTINATION ${glade_moduledir}
+)
diff --git a/maint/gladeevolution.c b/maint/gladeevolution.c
new file mode 100644
index 0000000..0a4be08
--- /dev/null
+++ b/maint/gladeevolution.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library 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 Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Really nothing to be here, the glade catalog requires the module
+   and this source file is here "to have something to compile" only.
+ */
\ No newline at end of file
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
new file mode 100644
index 0000000..0217080
--- /dev/null
+++ b/modules/CMakeLists.txt
@@ -0,0 +1,140 @@
+macro(add_simple_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar _destination)
+       set(DEPENDENCIES
+               evolution-util
+       )
+
+       set(SOURCES
+               ${${_sourcesvar}}
+       )
+
+       add_library(${_name} MODULE
+               ${SOURCES}
+       )
+
+       set_target_properties(${_name} PROPERTIES
+               PREFIX ""
+       )
+
+       add_dependencies(${_name}
+               ${DEPENDENCIES}
+               ${${_depsvar}}
+       )
+
+       target_compile_definitions(${_name} PRIVATE
+               -DG_LOG_DOMAIN=\"${_name}\"
+               ${${_defsvar}}
+       )
+
+       target_compile_options(${_name} PUBLIC
+               ${EVOLUTION_DATA_SERVER_CFLAGS}
+               ${GNOME_PLATFORM_CFLAGS}
+               ${${_cflagsvar}}
+       )
+
+       target_include_directories(${_name} PUBLIC
+               ${CMAKE_BINARY_DIR}
+               ${CMAKE_SOURCE_DIR}
+               ${CMAKE_CURRENT_SOURCE_DIR}
+               ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+               ${GNOME_PLATFORM_INCLUDE_DIRS}
+               ${${_incdirsvar}}
+       )
+
+       target_link_libraries(${_name}
+               ${DEPENDENCIES}
+               ${${_depsvar}}
+               ${EVOLUTION_DATA_SERVER_LDFLAGS}
+               ${GNOME_PLATFORM_LDFLAGS}
+               ${${_ldflagsvar}}
+       )
+
+       install(TARGETS ${_name}
+               DESTINATION ${_destination}
+       )
+endmacro(add_simple_module)
+
+macro(add_evolution_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+       add_simple_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} ${_incdirsvar} 
${_ldflagsvar} ${moduledir})
+endmacro(add_evolution_module)
+
+macro(add_simple_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar 
_destdir)
+       set(wex_deps
+               ${${_depsvar}}
+               edomutils
+       )
+       set(wex_cflags
+               ${${_cflagsvar}}
+               ${WEB_EXTENSIONS_CFLAGS}
+       )
+       set(wex_incdirs
+               ${${_incdirsvar}}
+               ${WEB_EXTENSIONS_INCLUDE_DIRS}
+       )
+       set(wex_ldflags
+               ${${_ldflagsvar}}
+               ${WEB_EXTENSIONS_LDFLAGS}
+       )
+
+       add_simple_module(${_name} ${_sourcesvar} wex_deps ${_defsvar} wex_cflags wex_incdirs wex_ldflags 
${_destdir})
+endmacro(add_simple_webextension_module)
+
+macro(add_webextension_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+       add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} 
${_incdirsvar} ${_ldflagsvar} "${webextensionsdir}")
+endmacro(add_webextension_module)
+
+macro(add_webextension_editor_module _name _sourcesvar _depsvar _defsvar _cflagsvar _incdirsvar _ldflagsvar)
+       add_simple_webextension_module(${_name} ${_sourcesvar} ${_depsvar} ${_defsvar} ${_cflagsvar} 
${_incdirsvar} ${_ldflagsvar} "${webextensionswebkiteditordir}")
+endmacro(add_webextension_editor_module)
+
+add_subdirectory(addressbook)
+add_subdirectory(calendar)
+add_subdirectory(mail)
+add_subdirectory(backup-restore)
+add_subdirectory(book-config-google)
+add_subdirectory(book-config-local)
+add_subdirectory(book-config-webdav)
+add_subdirectory(cal-config-caldav)
+add_subdirectory(cal-config-contacts)
+add_subdirectory(cal-config-google)
+add_subdirectory(cal-config-local)
+add_subdirectory(cal-config-webcal)
+add_subdirectory(composer-autosave)
+add_subdirectory(contact-photos)
+add_subdirectory(gravatar)
+add_subdirectory(itip-formatter)
+add_subdirectory(mail-config)
+add_subdirectory(mailto-handler)
+add_subdirectory(mdn)
+add_subdirectory(offline-alert)
+add_subdirectory(plugin-lib)
+add_subdirectory(plugin-manager)
+add_subdirectory(prefer-plain)
+add_subdirectory(settings)
+add_subdirectory(startup-wizard)
+add_subdirectory(vcard-inline)
+add_subdirectory(webkit-editor)
+add_subdirectory(webkit-inspector)
+
+if(ENABLE_TEXT_HIGHLIGHT)
+       add_subdirectory(text-highlight)
+endif(ENABLE_TEXT_HIGHLIGHT)
+
+if(ENABLE_WEATHER)
+       add_subdirectory(cal-config-weather)
+endif(ENABLE_WEATHER)
+
+if(ENABLE_YTNEF)
+       add_subdirectory(tnef-attachment)
+endif(ENABLE_YTNEF)
+
+if(HAVE_LDAP)
+       add_subdirectory(book-config-ldap)
+endif(HAVE_LDAP)
+
+if(WITH_BOGOFILTER)
+       add_subdirectory(bogofilter)
+endif(WITH_BOGOFILTER)
+
+if(WITH_SPAMASSASSIN)
+       add_subdirectory(spamassassin)
+endif(WITH_SPAMASSASSIN)
diff --git a/modules/addressbook/CMakeLists.txt b/modules/addressbook/CMakeLists.txt
new file mode 100644
index 0000000..cdfdd13
--- /dev/null
+++ b/modules/addressbook/CMakeLists.txt
@@ -0,0 +1,67 @@
+set(extra_deps
+       eabutil
+       eabwidgets
+       econtacteditor
+       econtactlisteditor
+       econtactprint
+       evolution-addressbook-importers
+       evolution-mail-composer
+       evolution-shell
+)
+if(ENABLE_SMIME)
+       list(APPEND extra_deps evolution-smime)
+endif(ENABLE_SMIME)
+
+set(sources
+       evolution-module-addressbook.c
+       autocompletion-config.c
+       autocompletion-config.h
+       eab-composer-util.c
+       eab-composer-util.h
+       e-book-config-hook.c
+       e-book-config-hook.h
+       e-book-shell-backend.c
+       e-book-shell-backend.h
+       e-book-shell-content.c
+       e-book-shell-content.h
+       e-book-shell-migrate.c
+       e-book-shell-migrate.h
+       e-book-shell-sidebar.c
+       e-book-shell-sidebar.h
+       e-book-shell-view.c
+       e-book-shell-view.h
+       e-book-shell-view-actions.c
+       e-book-shell-view-actions.h
+       e-book-shell-view-private.c
+       e-book-shell-view-private.h
+)
+set(extra_defines)
+set(extra_cflags
+       ${CHAMPLAIN_CFLAGS}
+       ${LDAP_CFLAGS}
+)
+set(extra_incdirs
+       ${CMAKE_BINARY_DIR}/addressbook/util
+       ${CMAKE_BINARY_DIR}/addressbook/gui/contact-editor
+       ${CMAKE_BINARY_DIR}/addressbook/gui/contact-list-editor
+       ${CMAKE_BINARY_DIR}/addressbook/gui/widgets
+       ${CMAKE_SOURCE_DIR}/addressbook/util
+       ${CMAKE_SOURCE_DIR}/addressbook/gui/contact-editor
+       ${CMAKE_SOURCE_DIR}/addressbook/gui/contact-list-editor
+       ${CMAKE_SOURCE_DIR}/addressbook/gui/widgets
+       ${CHAMPLAIN_INCLUDE_DIRS}
+       ${LDAP_INCLUDE_DIRS}
+)
+set(extra_ldflags
+       ${CHAMPLAIN_LDFLAGS}
+       ${LDAP_LDFLAGS}
+)
+
+add_evolution_module(module-addressbook
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/addressbook/autocompletion-config.c b/modules/addressbook/autocompletion-config.c
index cc7c7ec..de9baa7 100644
--- a/modules/addressbook/autocompletion-config.c
+++ b/modules/addressbook/autocompletion-config.c
@@ -21,11 +21,12 @@
  *
  */
 
-#include "autocompletion-config.h"
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
 #include "addressbook/gui/widgets/eab-config.h"
+#include "autocompletion-config.h"
 
 static GtkWidget *
 add_section (GtkWidget *container,
diff --git a/modules/addressbook/e-book-config-hook.c b/modules/addressbook/e-book-config-hook.c
index a5aa0ed..2fd5ae2 100644
--- a/modules/addressbook/e-book-config-hook.c
+++ b/modules/addressbook/e-book-config-hook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-config-hook.h"
 
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c
index 666120f..1c3a712 100644
--- a/modules/addressbook/e-book-shell-backend.c
+++ b/modules/addressbook/e-book-shell-backend.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-backend.h"
 
diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c
index e420079..efb973c 100644
--- a/modules/addressbook/e-book-shell-content.c
+++ b/modules/addressbook/e-book-shell-content.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-content.h"
 
diff --git a/modules/addressbook/e-book-shell-migrate.c b/modules/addressbook/e-book-shell-migrate.c
index bb05455..17f6db6 100644
--- a/modules/addressbook/e-book-shell-migrate.c
+++ b/modules/addressbook/e-book-shell-migrate.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-migrate.h"
 
diff --git a/modules/addressbook/e-book-shell-sidebar.c b/modules/addressbook/e-book-shell-sidebar.c
index 97e31d0..b87252e 100644
--- a/modules/addressbook/e-book-shell-sidebar.c
+++ b/modules/addressbook/e-book-shell-sidebar.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-sidebar.h"
 
diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c
index 06c9c5d..1a66aca 100644
--- a/modules/addressbook/e-book-shell-view-actions.c
+++ b/modules/addressbook/e-book-shell-view-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-view-private.h"
 
@@ -320,7 +318,7 @@ action_address_book_refresh_cb (GtkAction *action,
        g_object_unref (client);
 }
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 static void
 contact_editor_contact_modified_cb (EABEditor *editor,
                                     const GError *error,
@@ -417,7 +415,7 @@ static void
 action_address_book_map_cb (GtkAction *action,
                             EBookShellView *book_shell_view)
 {
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
        EShell *shell;
        EShellView *shell_view;
        EShellBackend *shell_backend;
@@ -1394,7 +1392,7 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view)
        e_web_view_set_print_proxy (web_view, ACTION (CONTACT_PRINT));
        e_web_view_set_save_as_proxy (web_view, ACTION (CONTACT_SAVE_AS));
 
-#ifndef WITH_CONTACT_MAPS
+#ifndef ENABLE_CONTACT_MAPS
        gtk_action_set_visible (ACTION (CONTACT_PREVIEW_SHOW_MAPS), FALSE);
        gtk_action_set_visible (ACTION (ADDRESS_BOOK_MAP), FALSE);
        gtk_action_set_visible (ACTION (ADDRESS_BOOK_POPUP_MAP), FALSE);
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index 59d3584..fa3081f 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util/e-util-private.h"
 
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 3b4e563..f8281a5 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-shell-view-private.h"
 
diff --git a/modules/addressbook/eab-composer-util.c b/modules/addressbook/eab-composer-util.c
index 94e8aaf..bbc2efe 100644
--- a/modules/addressbook/eab-composer-util.c
+++ b/modules/addressbook/eab-composer-util.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "eab-composer-util.h"
 
diff --git a/modules/addressbook/evolution-module-addressbook.c 
b/modules/addressbook/evolution-module-addressbook.c
index 78df57c..574fb07 100644
--- a/modules/addressbook/evolution-module-addressbook.c
+++ b/modules/addressbook/evolution-module-addressbook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-book-config-hook.h"
 
diff --git a/modules/backup-restore/CMakeLists.txt b/modules/backup-restore/CMakeLists.txt
new file mode 100644
index 0000000..6427f25
--- /dev/null
+++ b/modules/backup-restore/CMakeLists.txt
@@ -0,0 +1,79 @@
+add_error_files(backup-restore org-gnome-backup-restore.error)
+
+set(extra_deps
+       email-engine
+       evolution-mail
+       evolution-shell
+)
+set(sources
+       evolution-backup-restore.c
+       e-mail-config-restore-page.c
+       e-mail-config-restore-page.h
+       e-mail-config-restore-ready-page.c
+       e-mail-config-restore-ready-page.h
+)
+set(extra_defines
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-backup-restore
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
+
+# ******************************
+# evolution-backup binary
+# ******************************
+
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       evolution-backup-tool.c
+)
+
+add_executable(evolution-backup
+       ${SOURCES}
+)
+
+add_dependencies(evolution-backup
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-backup PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-backup\"
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       -DDBUS_SERVICES_DIR=\"${SHARE_INSTALL_DIR}/dbus-1/services\"
+)
+
+target_compile_options(evolution-backup PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-backup PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-backup
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-backup
+       DESTINATION ${privlibexecdir}
+)
diff --git a/modules/backup-restore/e-mail-config-restore-page.c 
b/modules/backup-restore/e-mail-config-restore-page.c
index e0b32f8..f0270fd 100644
--- a/modules/backup-restore/e-mail-config-restore-page.c
+++ b/modules/backup-restore/e-mail-config-restore-page.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-config-restore-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -28,6 +27,8 @@
 
 #include <e-util/e-util.h>
 
+#include "e-mail-config-restore-page.h"
+
 #define E_MAIL_CONFIG_RESTORE_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_RESTORE_PAGE, EMailConfigRestorePagePrivate))
diff --git a/modules/backup-restore/e-mail-config-restore-ready-page.c 
b/modules/backup-restore/e-mail-config-restore-ready-page.c
index 2638391..20a9176 100644
--- a/modules/backup-restore/e-mail-config-restore-ready-page.c
+++ b/modules/backup-restore/e-mail-config-restore-ready-page.c
@@ -20,11 +20,12 @@
  *       to restore.  As soon as we arrive on this page we execl() the
  *       "evolution-backup" tool, and the startup wizard disappears. */
 
-#include "e-mail-config-restore-ready-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-config-restore-ready-page.h"
+
 /* Forward Declarations */
 static void    e_mail_config_restore_ready_page_interface_init
                                        (EMailConfigPageInterface *iface);
diff --git a/modules/backup-restore/evolution-backup-restore.c 
b/modules/backup-restore/evolution-backup-restore.c
index fadb1a1..1b41886 100644
--- a/modules/backup-restore/evolution-backup-restore.c
+++ b/modules/backup-restore/evolution-backup-restore.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <unistd.h>
 #include <sys/types.h>
 #ifdef HAVE_SYS_WAIT_H
diff --git a/modules/backup-restore/evolution-backup-tool.c b/modules/backup-restore/evolution-backup-tool.c
index e0ed680..9a9881c 100644
--- a/modules/backup-restore/evolution-backup-tool.c
+++ b/modules/backup-restore/evolution-backup-tool.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/modules/bogofilter/CMakeLists.txt b/modules/bogofilter/CMakeLists.txt
new file mode 100644
index 0000000..39b43c7
--- /dev/null
+++ b/modules/bogofilter/CMakeLists.txt
@@ -0,0 +1,23 @@
+add_appdata_file(evolution-bogofilter.metainfo.xml.in evolution-bogofilter.metainfo.xml)
+
+set(extra_deps
+       email-engine
+)
+set(sources
+       evolution-bogofilter.c
+)
+set(extra_defines
+       -DWELCOME_MESSAGE=\"${privdatadir}/default/C/mail/local/Inbox\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-bogofilter
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/bogofilter/evolution-bogofilter.c b/modules/bogofilter/evolution-bogofilter.c
index 50e81e2..d09c2fa 100644
--- a/modules/bogofilter/evolution-bogofilter.c
+++ b/modules/bogofilter/evolution-bogofilter.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <sys/wait.h>
diff --git a/modules/book-config-google/CMakeLists.txt b/modules/book-config-google/CMakeLists.txt
new file mode 100644
index 0000000..d455caf
--- /dev/null
+++ b/modules/book-config-google/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-book-config-google.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-book-config-google
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/book-config-google/evolution-book-config-google.c 
b/modules/book-config-google/evolution-book-config-google.c
index 91eeb8c..1d00ea4 100644
--- a/modules/book-config-google/evolution-book-config-google.c
+++ b/modules/book-config-google/evolution-book-config-google.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/book-config-ldap/CMakeLists.txt b/modules/book-config-ldap/CMakeLists.txt
new file mode 100644
index 0000000..7bcf9ef
--- /dev/null
+++ b/modules/book-config-ldap/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(extra_deps)
+set(sources
+       evolution-book-config-ldap.c
+)
+set(extra_defines)
+set(extra_cflags
+       ${LDAP_CFLAGS}
+)
+set(extra_incdirs
+       ${LDAP_INCLUDE_DIRS}
+)
+set(extra_ldflags
+       ${LDAP_LIBS}
+)
+
+add_evolution_module(module-book-config-ldap
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/book-config-ldap/evolution-book-config-ldap.c 
b/modules/book-config-ldap/evolution-book-config-ldap.c
index 2ff38ef..d00a79a 100644
--- a/modules/book-config-ldap/evolution-book-config-ldap.c
+++ b/modules/book-config-ldap/evolution-book-config-ldap.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <stdlib.h>
 #include <glib/gi18n-lib.h>
 
diff --git a/modules/book-config-local/CMakeLists.txt b/modules/book-config-local/CMakeLists.txt
new file mode 100644
index 0000000..f057cbb
--- /dev/null
+++ b/modules/book-config-local/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-book-config-local.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-book-config-local
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/book-config-local/evolution-book-config-local.c 
b/modules/book-config-local/evolution-book-config-local.c
index 816507c..b209973 100644
--- a/modules/book-config-local/evolution-book-config-local.c
+++ b/modules/book-config-local/evolution-book-config-local.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/book-config-webdav/CMakeLists.txt b/modules/book-config-webdav/CMakeLists.txt
new file mode 100644
index 0000000..91d7906
--- /dev/null
+++ b/modules/book-config-webdav/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-book-config-webdav.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-book-config-webdav
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/book-config-webdav/evolution-book-config-webdav.c 
b/modules/book-config-webdav/evolution-book-config-webdav.c
index ad739a7..9c7fea8 100644
--- a/modules/book-config-webdav/evolution-book-config-webdav.c
+++ b/modules/book-config-webdav/evolution-book-config-webdav.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-caldav/CMakeLists.txt b/modules/cal-config-caldav/CMakeLists.txt
new file mode 100644
index 0000000..cc28d96
--- /dev/null
+++ b/modules/cal-config-caldav/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-cal-config-caldav.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-cal-config-caldav
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-caldav/evolution-cal-config-caldav.c 
b/modules/cal-config-caldav/evolution-cal-config-caldav.c
index 0e39034..fca6b04 100644
--- a/modules/cal-config-caldav/evolution-cal-config-caldav.c
+++ b/modules/cal-config-caldav/evolution-cal-config-caldav.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-contacts/CMakeLists.txt b/modules/cal-config-contacts/CMakeLists.txt
new file mode 100644
index 0000000..376f1d8
--- /dev/null
+++ b/modules/cal-config-contacts/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(extra_deps)
+set(sources
+       evolution-cal-config-contacts.c
+       e-contacts-selector.c
+       e-contacts-selector.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-cal-config-contacts
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-contacts/e-contacts-selector.c 
b/modules/cal-config-contacts/e-contacts-selector.c
index 5972d45..3d0486c 100644
--- a/modules/cal-config-contacts/e-contacts-selector.c
+++ b/modules/cal-config-contacts/e-contacts-selector.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libedataserver/libedataserver.h>
 
diff --git a/modules/cal-config-contacts/evolution-cal-config-contacts.c 
b/modules/cal-config-contacts/evolution-cal-config-contacts.c
index 290d421..a311c41 100644
--- a/modules/cal-config-contacts/evolution-cal-config-contacts.c
+++ b/modules/cal-config-contacts/evolution-cal-config-contacts.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-google/CMakeLists.txt b/modules/cal-config-google/CMakeLists.txt
new file mode 100644
index 0000000..48eda74
--- /dev/null
+++ b/modules/cal-config-google/CMakeLists.txt
@@ -0,0 +1,22 @@
+set(extra_deps)
+set(sources
+       e-cal-config-google.c
+       e-cal-config-gtasks.c
+       e-google-chooser-button.c
+       e-google-chooser-button.h
+       module-cal-config-google.c
+       module-cal-config-google.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-cal-config-google
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-google/e-cal-config-google.c b/modules/cal-config-google/e-cal-config-google.c
index c7dd42d..675a210 100644
--- a/modules/cal-config-google/e-cal-config-google.c
+++ b/modules/cal-config-google/e-cal-config-google.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-google/e-cal-config-gtasks.c b/modules/cal-config-google/e-cal-config-gtasks.c
index bb21a14..d25bb7d 100644
--- a/modules/cal-config-google/e-cal-config-gtasks.c
+++ b/modules/cal-config-google/e-cal-config-gtasks.c
@@ -13,9 +13,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/cal-config-google/e-google-chooser-button.c 
b/modules/cal-config-google/e-google-chooser-button.c
index 653bcad..cdd5369 100644
--- a/modules/cal-config-google/e-google-chooser-button.c
+++ b/modules/cal-config-google/e-google-chooser-button.c
@@ -15,13 +15,14 @@
  *
  */
 
-#include "e-google-chooser-button.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libedataserverui/libedataserverui.h>
 
+#include "e-google-chooser-button.h"
+
 #define E_GOOGLE_CHOOSER_BUTTON_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_GOOGLE_CHOOSER_BUTTON, EGoogleChooserButtonPrivate))
diff --git a/modules/cal-config-google/module-cal-config-google.c 
b/modules/cal-config-google/module-cal-config-google.c
index 9085843..79f6020 100644
--- a/modules/cal-config-google/module-cal-config-google.c
+++ b/modules/cal-config-google/module-cal-config-google.c
@@ -13,9 +13,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libebackend/libebackend.h>
 
diff --git a/modules/cal-config-local/CMakeLists.txt b/modules/cal-config-local/CMakeLists.txt
new file mode 100644
index 0000000..22f5ab5
--- /dev/null
+++ b/modules/cal-config-local/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-cal-config-local.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-cal-config-local
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-local/evolution-cal-config-local.c 
b/modules/cal-config-local/evolution-cal-config-local.c
index eb9edf7..dad56b6 100644
--- a/modules/cal-config-local/evolution-cal-config-local.c
+++ b/modules/cal-config-local/evolution-cal-config-local.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-weather/CMakeLists.txt b/modules/cal-config-weather/CMakeLists.txt
new file mode 100644
index 0000000..b610b0b
--- /dev/null
+++ b/modules/cal-config-weather/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(extra_deps)
+set(sources
+       evolution-cal-config-weather.c
+)
+set(extra_defines)
+set(extra_cflags
+       ${GWEATHER_CFLAGS}
+)
+set(extra_incdirs
+       ${GWEATHER_INCLUDE_DIRS}
+)
+set(extra_ldflags
+       ${GWEATHER_LDFLAGS}
+)
+
+add_evolution_module(module-cal-config-weather
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-weather/evolution-cal-config-weather.c 
b/modules/cal-config-weather/evolution-cal-config-weather.c
index e02b2d6..e431674 100644
--- a/modules/cal-config-weather/evolution-cal-config-weather.c
+++ b/modules/cal-config-weather/evolution-cal-config-weather.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/cal-config-webcal/CMakeLists.txt b/modules/cal-config-webcal/CMakeLists.txt
new file mode 100644
index 0000000..2253a59
--- /dev/null
+++ b/modules/cal-config-webcal/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-cal-config-webcal.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-cal-config-webcal
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/cal-config-webcal/evolution-cal-config-webcal.c 
b/modules/cal-config-webcal/evolution-cal-config-webcal.c
index e6b933e..f24f94f 100644
--- a/modules/cal-config-webcal/evolution-cal-config-webcal.c
+++ b/modules/cal-config-webcal/evolution-cal-config-webcal.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <libebackend/libebackend.h>
diff --git a/modules/calendar/CMakeLists.txt b/modules/calendar/CMakeLists.txt
new file mode 100644
index 0000000..ec6c754
--- /dev/null
+++ b/modules/calendar/CMakeLists.txt
@@ -0,0 +1,87 @@
+install(FILES e-calendar-preferences.ui
+       DESTINATION ${uidir}
+)
+
+set(extra_deps
+       econtacteditor
+       econtactlisteditor
+       evolution-calendar
+       evolution-calendar-importers
+       evolution-mail
+       evolution-shell
+       gnomecanvas
+)
+set(sources
+       evolution-module-calendar.c
+       e-cal-attachment-handler.c
+       e-cal-attachment-handler.h
+       e-cal-base-shell-backend.c
+       e-cal-base-shell-backend.h
+       e-cal-base-shell-content.c
+       e-cal-base-shell-content.h
+       e-cal-base-shell-sidebar.c
+       e-cal-base-shell-sidebar.h
+       e-cal-base-shell-view.c
+       e-cal-base-shell-view.h
+       e-cal-config-hook.c
+       e-cal-config-hook.h
+       e-cal-event-hook.c
+       e-cal-event-hook.h
+       e-cal-shell-backend.c
+       e-cal-shell-backend.h
+       e-cal-shell-content.c
+       e-cal-shell-content.h
+       e-cal-shell-migrate.c
+       e-cal-shell-migrate.h
+       e-cal-shell-view.c
+       e-cal-shell-view.h
+       e-cal-shell-view-actions.c
+       e-cal-shell-view-actions.h
+       e-cal-shell-view-private.c
+       e-cal-shell-view-private.h
+       e-cal-shell-view-memopad.c
+       e-cal-shell-view-taskpad.c
+       e-calendar-preferences.c
+       e-calendar-preferences.h
+       e-memo-shell-backend.c
+       e-memo-shell-backend.h
+       e-memo-shell-content.c
+       e-memo-shell-content.h
+       e-memo-shell-migrate.c
+       e-memo-shell-migrate.h
+       e-memo-shell-view.c
+       e-memo-shell-view.h
+       e-memo-shell-view-actions.c
+       e-memo-shell-view-actions.h
+       e-memo-shell-view-private.c
+       e-memo-shell-view-private.h
+       e-task-shell-backend.c
+       e-task-shell-backend.h
+       e-task-shell-content.c
+       e-task-shell-content.h
+       e-task-shell-migrate.c
+       e-task-shell-migrate.h
+       e-task-shell-view.c
+       e-task-shell-view.h
+       e-task-shell-view-actions.c
+       e-task-shell-view-actions.h
+       e-task-shell-view-private.c
+       e-task-shell-view-private.h
+)
+set(extra_defines
+       -DEVOLUTION_PRIVLIBEXECDIR=\"${privlibexecdir}\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags
+       ${MATH_LDFLAGS}
+)
+
+add_evolution_module(module-calendar
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index ef28ddd..989e136 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-attachment-handler.h"
 
diff --git a/modules/calendar/e-cal-base-shell-backend.c b/modules/calendar/e-cal-base-shell-backend.c
index 473f822..a1b5d4a 100644
--- a/modules/calendar/e-cal-base-shell-backend.c
+++ b/modules/calendar/e-cal-base-shell-backend.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-cal-base-shell-content.c b/modules/calendar/e-cal-base-shell-content.c
index 399aa85..a0a60e4 100644
--- a/modules/calendar/e-cal-base-shell-content.c
+++ b/modules/calendar/e-cal-base-shell-content.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-cal-base-shell-sidebar.c b/modules/calendar/e-cal-base-shell-sidebar.c
index da10449..937e212 100644
--- a/modules/calendar/e-cal-base-shell-sidebar.c
+++ b/modules/calendar/e-cal-base-shell-sidebar.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/calendar/e-cal-base-shell-view.c b/modules/calendar/e-cal-base-shell-view.c
index 8d9a92c..2833542 100644
--- a/modules/calendar/e-cal-base-shell-view.c
+++ b/modules/calendar/e-cal-base-shell-view.c
@@ -16,9 +16,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-cal-config-hook.c b/modules/calendar/e-cal-config-hook.c
index 716851c..089f2b6 100644
--- a/modules/calendar/e-cal-config-hook.c
+++ b/modules/calendar/e-cal-config-hook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-config-hook.h"
 
diff --git a/modules/calendar/e-cal-event-hook.c b/modules/calendar/e-cal-event-hook.c
index 0dfb748..7e88f53 100644
--- a/modules/calendar/e-cal-event-hook.c
+++ b/modules/calendar/e-cal-event-hook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-event-hook.h"
 
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 35a58fb..2cde083 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c
index 114ab8d..6394dae 100644
--- a/modules/calendar/e-cal-shell-content.c
+++ b/modules/calendar/e-cal-shell-content.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <math.h>
diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c
index adf2390..a92b98f 100644
--- a/modules/calendar/e-cal-shell-migrate.c
+++ b/modules/calendar/e-cal-shell-migrate.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-shell-migrate.h"
 
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index bc40565..9fc0e6f 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "calendar/gui/e-cal-dialogs.h"
 #include "calendar/gui/e-cal-ops.h"
diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c
index 58068f3..198d492 100644
--- a/modules/calendar/e-cal-shell-view-memopad.c
+++ b/modules/calendar/e-cal-shell-view-memopad.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "calendar/gui/e-cal-ops.h"
 #include "calendar/gui/itip-utils.h"
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index e9b179d..95a8ca8 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util/e-util-private.h"
 #include <calendar/gui/e-cal-ops.h>
diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c
index b49667e..891bbb1 100644
--- a/modules/calendar/e-cal-shell-view-taskpad.c
+++ b/modules/calendar/e-cal-shell-view-taskpad.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "calendar/gui/e-cal-ops.h"
 #include "calendar/gui/itip-utils.h"
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 139dc23..2a354bf 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-calendar-preferences.c b/modules/calendar/e-calendar-preferences.c
index 63bc7c9..6a0158e 100644
--- a/modules/calendar/e-calendar-preferences.c
+++ b/modules/calendar/e-calendar-preferences.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-calendar-preferences.h"
 
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index cea61fb..f47167e 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -17,9 +17,7 @@
  * Authors: Milan Crha <mcrha redhat com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c
index 5c81731..7dacbfb 100644
--- a/modules/calendar/e-memo-shell-content.c
+++ b/modules/calendar/e-memo-shell-content.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-memo-shell-migrate.c b/modules/calendar/e-memo-shell-migrate.c
index b209d2c..b379a10 100644
--- a/modules/calendar/e-memo-shell-migrate.c
+++ b/modules/calendar/e-memo-shell-migrate.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-memo-shell-migrate.h"
 
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index c883b4d..5c2c0a8 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "calendar/gui/e-cal-ops.h"
 #include "calendar/gui/itip-utils.h"
diff --git a/modules/calendar/e-memo-shell-view-private.c b/modules/calendar/e-memo-shell-view-private.c
index 3785942..393d299 100644
--- a/modules/calendar/e-memo-shell-view-private.c
+++ b/modules/calendar/e-memo-shell-view-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util/e-util-private.h"
 #include <calendar/gui/e-cal-ops.h>
diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c
index 1804e6b..04d71c8 100644
--- a/modules/calendar/e-memo-shell-view.c
+++ b/modules/calendar/e-memo-shell-view.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c
index 43ccaec..1e5f6a3 100644
--- a/modules/calendar/e-task-shell-backend.c
+++ b/modules/calendar/e-task-shell-backend.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c
index f8d2b53..c425d8f 100644
--- a/modules/calendar/e-task-shell-content.c
+++ b/modules/calendar/e-task-shell-content.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c
index 8de9255..2659fb8 100644
--- a/modules/calendar/e-task-shell-migrate.c
+++ b/modules/calendar/e-task-shell-migrate.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-task-shell-migrate.h"
 
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index d7bc023..f8e57eb 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "calendar/gui/e-cal-ops.h"
 #include "calendar/gui/itip-utils.h"
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 4022127..17611df 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-util/e-util-private.h"
 #include <calendar/gui/e-cal-ops.h>
diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c
index c731b1f..21193f9 100644
--- a/modules/calendar/e-task-shell-view.c
+++ b/modules/calendar/e-task-shell-view.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/modules/calendar/evolution-module-calendar.c b/modules/calendar/evolution-module-calendar.c
index 17e73b1..d8e4ba3 100644
--- a/modules/calendar/evolution-module-calendar.c
+++ b/modules/calendar/evolution-module-calendar.c
@@ -15,9 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cal-attachment-handler.h"
 
diff --git a/modules/composer-autosave/CMakeLists.txt b/modules/composer-autosave/CMakeLists.txt
new file mode 100644
index 0000000..8cb0027
--- /dev/null
+++ b/modules/composer-autosave/CMakeLists.txt
@@ -0,0 +1,26 @@
+set(extra_deps
+       evolution-mail-composer
+       evolution-shell
+)
+set(sources
+       evolution-composer-autosave.c
+       e-autosave-utils.c
+       e-autosave-utils.h
+       e-composer-autosave.c
+       e-composer-autosave.h
+       e-composer-registry.c
+       e-composer-registry.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-composer-autosave
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/composer-autosave/e-autosave-utils.c b/modules/composer-autosave/e-autosave-utils.c
index 19a64b1..4fc6234 100644
--- a/modules/composer-autosave/e-autosave-utils.c
+++ b/modules/composer-autosave/e-autosave-utils.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-autosave-utils.h"
 
diff --git a/modules/composer-autosave/e-composer-autosave.c b/modules/composer-autosave/e-composer-autosave.c
index eabc2e1..efab816 100644
--- a/modules/composer-autosave/e-composer-autosave.c
+++ b/modules/composer-autosave/e-composer-autosave.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-composer-autosave.h"
 
diff --git a/modules/composer-autosave/e-composer-registry.c b/modules/composer-autosave/e-composer-registry.c
index 1048563..29b2118 100644
--- a/modules/composer-autosave/e-composer-registry.c
+++ b/modules/composer-autosave/e-composer-registry.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-composer-registry.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gstdio.h>
 #include <libebackend/libebackend.h>
 
@@ -27,6 +26,8 @@
 
 #include "e-autosave-utils.h"
 
+#include "e-composer-registry.h"
+
 #define E_COMPOSER_REGISTRY_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_COMPOSER_REGISTRY, EComposerRegistryPrivate))
diff --git a/modules/contact-photos/CMakeLists.txt b/modules/contact-photos/CMakeLists.txt
new file mode 100644
index 0000000..99372ab
--- /dev/null
+++ b/modules/contact-photos/CMakeLists.txt
@@ -0,0 +1,21 @@
+set(extra_deps)
+set(sources
+       evolution-contact-photos.c
+       e-contact-photo-source.c
+       e-contact-photo-source.h
+       e-photo-cache-contact-loader.c
+       e-photo-cache-contact-loader.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-contact-photos
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/gravatar/CMakeLists.txt b/modules/gravatar/CMakeLists.txt
new file mode 100644
index 0000000..150577e
--- /dev/null
+++ b/modules/gravatar/CMakeLists.txt
@@ -0,0 +1,21 @@
+set(extra_deps)
+set(sources
+       evolution-module-gravatar.c
+       e-gravatar-photo-source.c
+       e-gravatar-photo-source.h
+       e-photo-cache-gravatar-loader.c
+       e-photo-cache-gravatar-loader.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-gravatar
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/itip-formatter/CMakeLists.txt b/modules/itip-formatter/CMakeLists.txt
new file mode 100644
index 0000000..b6f8e19
--- /dev/null
+++ b/modules/itip-formatter/CMakeLists.txt
@@ -0,0 +1,36 @@
+add_error_files(itip-formatter org-gnome-itip-formatter.error)
+
+set(extra_deps
+       email-engine
+       evolution-calendar
+       evolution-mail
+       evolution-mail-formatter
+       evolution-shell
+)
+set(sources
+       e-mail-formatter-itip.c
+       e-mail-formatter-itip.h
+       e-mail-parser-itip.c
+       e-mail-parser-itip.h
+       e-mail-part-itip.c
+       e-mail-part-itip.h
+       itip-view.c
+       itip-view.h
+       evolution-module-itip-formatter.c
+       itip-view-elements-defines.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-itip-formatter
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
+
+add_subdirectory(web-extension)
diff --git a/modules/itip-formatter/e-mail-formatter-itip.c b/modules/itip-formatter/e-mail-formatter-itip.c
index 9ac5751..a77bdbe 100644
--- a/modules/itip-formatter/e-mail-formatter-itip.c
+++ b/modules/itip-formatter/e-mail-formatter-itip.c
@@ -15,11 +15,7 @@
  *
  */
 
-#include "e-mail-formatter-itip.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
@@ -31,6 +27,8 @@
 #include "itip-view.h"
 #include "e-mail-part-itip.h"
 
+#include "e-mail-formatter-itip.h"
+
 #define d(x)
 
 typedef EMailFormatterExtension EMailFormatterItip;
diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c
index 6b60153..7ef3325 100644
--- a/modules/itip-formatter/e-mail-parser-itip.c
+++ b/modules/itip-formatter/e-mail-parser-itip.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/modules/itip-formatter/e-mail-part-itip.c b/modules/itip-formatter/e-mail-part-itip.c
index fbb4ffb..7b1f7dd 100644
--- a/modules/itip-formatter/e-mail-part-itip.c
+++ b/modules/itip-formatter/e-mail-part-itip.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <e-util/e-util.h>
diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c
index 4ffde23..e6d470a 100644
--- a/modules/itip-formatter/itip-view.c
+++ b/modules/itip-formatter/itip-view.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/modules/itip-formatter/web-extension/CMakeLists.txt 
b/modules/itip-formatter/web-extension/CMakeLists.txt
new file mode 100644
index 0000000..431004e
--- /dev/null
+++ b/modules/itip-formatter/web-extension/CMakeLists.txt
@@ -0,0 +1,20 @@
+set(extra_deps)
+set(sources
+       module-itip-formatter-web-extension.c
+       module-itip-formatter-web-extension.h
+       module-itip-formatter-dom-utils.c
+       module-itip-formatter-dom-utils.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_webextension_module(module-itip-formatter-webextension
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/mail-config/CMakeLists.txt b/modules/mail-config/CMakeLists.txt
new file mode 100644
index 0000000..4061ce2
--- /dev/null
+++ b/modules/mail-config/CMakeLists.txt
@@ -0,0 +1,30 @@
+set(extra_deps
+       email-engine
+       evolution-mail
+)
+set(sources
+       evolution-mail-config.c
+       e-mail-config-local-accounts.c
+       e-mail-config-remote-accounts.c
+       e-mail-config-sendmail-backend.c
+       e-mail-config-sendmail-backend.h
+       e-mail-config-smtp-backend.c
+       e-mail-config-smtp-backend.h
+       e-mail-config-google-summary.c
+       e-mail-config-google-summary.h
+       e-mail-config-yahoo-summary.c
+       e-mail-config-yahoo-summary.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-mail-config
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/mail-config/e-mail-config-google-summary.c 
b/modules/mail-config/e-mail-config-google-summary.c
index 0bbeb37..af33744 100644
--- a/modules/mail-config/e-mail-config-google-summary.c
+++ b/modules/mail-config/e-mail-config-google-summary.c
@@ -15,14 +15,15 @@
  *
  */
 
-#include "e-mail-config-google-summary.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <libedataserver/libedataserver.h>
 #include <mail/e-mail-config-summary-page.h>
 
+#include "e-mail-config-google-summary.h"
+
 #define E_MAIL_CONFIG_GOOGLE_SUMMARY_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_GOOGLE_SUMMARY, EMailConfigGoogleSummaryPrivate))
diff --git a/modules/mail-config/e-mail-config-local-accounts.c 
b/modules/mail-config/e-mail-config-local-accounts.c
index 15d36a9..bd43107 100644
--- a/modules/mail-config/e-mail-config-local-accounts.c
+++ b/modules/mail-config/e-mail-config-local-accounts.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
diff --git a/modules/mail-config/e-mail-config-remote-accounts.c 
b/modules/mail-config/e-mail-config-remote-accounts.c
index 3782930..21c39e9 100644
--- a/modules/mail-config/e-mail-config-remote-accounts.c
+++ b/modules/mail-config/e-mail-config-remote-accounts.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
diff --git a/modules/mail-config/e-mail-config-sendmail-backend.c 
b/modules/mail-config/e-mail-config-sendmail-backend.c
index 1b0a003..5b516c1 100644
--- a/modules/mail-config/e-mail-config-sendmail-backend.c
+++ b/modules/mail-config/e-mail-config-sendmail-backend.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif 
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/modules/mail-config/e-mail-config-smtp-backend.c 
b/modules/mail-config/e-mail-config-smtp-backend.c
index e907375..68a8982 100644
--- a/modules/mail-config/e-mail-config-smtp-backend.c
+++ b/modules/mail-config/e-mail-config-smtp-backend.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-config-smtp-backend.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <camel/camel.h>
@@ -27,6 +26,8 @@
 #include <mail/e-mail-config-page.h>
 #include <mail/e-mail-config-service-page.h>
 
+#include "e-mail-config-smtp-backend.h"
+
 #define E_MAIL_CONFIG_SMTP_BACKEND_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_SMTP_BACKEND, EMailConfigSmtpBackendPrivate))
diff --git a/modules/mail-config/e-mail-config-yahoo-summary.c 
b/modules/mail-config/e-mail-config-yahoo-summary.c
index 10fceae..39dbd89 100644
--- a/modules/mail-config/e-mail-config-yahoo-summary.c
+++ b/modules/mail-config/e-mail-config-yahoo-summary.c
@@ -15,13 +15,14 @@
  *
  */
 
-#include "e-mail-config-yahoo-summary.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <mail/e-mail-config-summary-page.h>
 
+#include "e-mail-config-yahoo-summary.h"
+
 #define E_MAIL_CONFIG_YAHOO_SUMMARY_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_YAHOO_SUMMARY, EMailConfigYahooSummaryPrivate))
diff --git a/modules/mail/CMakeLists.txt b/modules/mail/CMakeLists.txt
new file mode 100644
index 0000000..ca27f5a
--- /dev/null
+++ b/modules/mail/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(extra_deps
+       email-engine
+       evolution-mail
+       evolution-mail-composer
+       evolution-mail-formatter
+       evolution-mail-importers
+       evolution-shell
+)
+set(sources
+       evolution-module-mail.c
+       e-mail-attachment-handler.c
+       e-mail-attachment-handler.h
+       e-mail-config-hook.c
+       e-mail-config-hook.h
+       e-mail-event-hook.c
+       e-mail-event-hook.h
+       e-mail-shell-backend.c
+       e-mail-shell-backend.h
+       e-mail-shell-content.c
+       e-mail-shell-content.h
+       e-mail-shell-sidebar.c
+       e-mail-shell-sidebar.h
+       e-mail-shell-view.c
+       e-mail-shell-view.h
+       e-mail-shell-view-actions.c
+       e-mail-shell-view-actions.h
+       e-mail-shell-view-private.c
+       e-mail-shell-view-private.h
+       em-account-prefs.c
+       em-account-prefs.h
+       em-composer-prefs.c
+       em-composer-prefs.h
+       em-mailer-prefs.c
+       em-mailer-prefs.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-mail
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/mail/e-mail-attachment-handler.c b/modules/mail/e-mail-attachment-handler.c
index a5252b8..e0825e3 100644
--- a/modules/mail/e-mail-attachment-handler.c
+++ b/modules/mail/e-mail-attachment-handler.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-attachment-handler.h"
 
diff --git a/modules/mail/e-mail-config-hook.c b/modules/mail/e-mail-config-hook.c
index ed844a4..9da10db 100644
--- a/modules/mail/e-mail-config-hook.c
+++ b/modules/mail/e-mail-config-hook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-config-hook.h"
 
diff --git a/modules/mail/e-mail-event-hook.c b/modules/mail/e-mail-event-hook.c
index e2d6d58..671330c 100644
--- a/modules/mail/e-mail-event-hook.c
+++ b/modules/mail/e-mail-event-hook.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-event-hook.h"
 
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 506b0d7..09e157e 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-backend.h"
 
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index 917c6cf..48ad047 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-content.h"
 
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index 8638d16..7c4ecb4 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-sidebar.h"
 
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index e9aea63..a2b77b3 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-view-private.h"
 
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index c7ff361..e8bed96 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-view-private.h"
 
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 6fae60a..3d25ed8 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-shell-view-private.h"
 
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index e4f0160..92d224e 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -24,9 +24,7 @@
  *     to someday move account management completely out of the mailer,
  *     perhaps to evolution-data-server. */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-account-prefs.h"
 #include "e-mail-shell-backend.h"
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index ecdcf40..2410cb7 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "em-composer-prefs.h"
 
diff --git a/modules/mail/em-mailer-prefs.c b/modules/mail/em-mailer-prefs.c
index de6ba47..c82234c 100644
--- a/modules/mail/em-mailer-prefs.c
+++ b/modules/mail/em-mailer-prefs.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
diff --git a/modules/mail/evolution-module-mail.c b/modules/mail/evolution-module-mail.c
index d52c365..6ca44e8 100644
--- a/modules/mail/evolution-module-mail.c
+++ b/modules/mail/evolution-module-mail.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-attachment-handler.h"
 
diff --git a/modules/mailto-handler/CMakeLists.txt b/modules/mailto-handler/CMakeLists.txt
new file mode 100644
index 0000000..3015b29
--- /dev/null
+++ b/modules/mailto-handler/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(extra_deps
+       evolution-shell
+)
+set(sources
+       evolution-mailto-handler.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-mailto-handler
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/mailto-handler/evolution-mailto-handler.c 
b/modules/mailto-handler/evolution-mailto-handler.c
index 9cd2c95..51fc582 100644
--- a/modules/mailto-handler/evolution-mailto-handler.c
+++ b/modules/mailto-handler/evolution-mailto-handler.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <libebackend/libebackend.h>
diff --git a/modules/mdn/CMakeLists.txt b/modules/mdn/CMakeLists.txt
new file mode 100644
index 0000000..687aca3
--- /dev/null
+++ b/modules/mdn/CMakeLists.txt
@@ -0,0 +1,23 @@
+add_error_files(mdn evolution-mdn.error)
+
+set(extra_deps
+       email-engine
+       evolution-mail
+       evolution-shell
+)
+set(sources
+       evolution-mdn.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-mdn
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/mdn/evolution-mdn.c b/modules/mdn/evolution-mdn.c
index 96744d5..1a8cbad 100644
--- a/modules/mdn/evolution-mdn.c
+++ b/modules/mdn/evolution-mdn.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <string.h>
 #include <glib/gi18n-lib.h>
 
@@ -325,7 +326,7 @@ mdn_notify_sender (ESource *identity_source,
 
        ua = g_strdup_printf (
                "%s; %s", hostname, "Evolution "
-               VERSION SUB_VERSION " " VERSION_COMMENT);
+               VERSION VERSION_SUBSTRING " " VERSION_COMMENT);
        recipient = g_strdup_printf ("rfc822; %s", self_address);
        disposition = mdn_get_disposition (action_mode, sending_mode);
 
diff --git a/modules/offline-alert/CMakeLists.txt b/modules/offline-alert/CMakeLists.txt
new file mode 100644
index 0000000..0e14b31
--- /dev/null
+++ b/modules/offline-alert/CMakeLists.txt
@@ -0,0 +1,21 @@
+add_error_files(offline-alert evolution-offline-alert.error)
+
+set(extra_deps
+       evolution-shell
+)
+set(sources
+       evolution-offline-alert.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-offline-alert
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/offline-alert/evolution-offline-alert.c b/modules/offline-alert/evolution-offline-alert.c
index db99dc1..fd11c9f 100644
--- a/modules/offline-alert/evolution-offline-alert.c
+++ b/modules/offline-alert/evolution-offline-alert.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libebackend/libebackend.h>
 
diff --git a/modules/plugin-lib/CMakeLists.txt b/modules/plugin-lib/CMakeLists.txt
new file mode 100644
index 0000000..f21059a
--- /dev/null
+++ b/modules/plugin-lib/CMakeLists.txt
@@ -0,0 +1,22 @@
+set(extra_deps)
+set(sources
+       evolution-module-plugin-lib.c
+       e-plugin-lib.c
+       e-plugin-lib.h
+)
+set(extra_defines
+       -DEVOLUTION_PLUGINDIR=\"${plugindir}\"
+       -DBUILDTIME_EVOLUTION_PLUGINDIR=\"${plugindir}\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-plugin-lib
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/plugin-lib/e-plugin-lib.c b/modules/plugin-lib/e-plugin-lib.c
index d4496f3..3bcce3b 100644
--- a/modules/plugin-lib/e-plugin-lib.c
+++ b/modules/plugin-lib/e-plugin-lib.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-plugin-lib.h"
 
diff --git a/modules/plugin-lib/evolution-module-plugin-lib.c 
b/modules/plugin-lib/evolution-module-plugin-lib.c
index bc85300..48d2e37 100644
--- a/modules/plugin-lib/evolution-module-plugin-lib.c
+++ b/modules/plugin-lib/evolution-module-plugin-lib.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-plugin-lib.h"
 
diff --git a/modules/plugin-manager/CMakeLists.txt b/modules/plugin-manager/CMakeLists.txt
new file mode 100644
index 0000000..c960500
--- /dev/null
+++ b/modules/plugin-manager/CMakeLists.txt
@@ -0,0 +1,19 @@
+set(extra_deps
+       evolution-shell
+)
+set(sources
+       evolution-plugin-manager.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-plugin-manager
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/plugin-manager/evolution-plugin-manager.c 
b/modules/plugin-manager/evolution-plugin-manager.c
index 4f7adb8..e80a2a0 100644
--- a/modules/plugin-manager/evolution-plugin-manager.c
+++ b/modules/plugin-manager/evolution-plugin-manager.c
@@ -15,9 +15,7 @@
 
 /* A plugin manager ui */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <stdio.h>
diff --git a/modules/prefer-plain/CMakeLists.txt b/modules/prefer-plain/CMakeLists.txt
new file mode 100644
index 0000000..44e9e59
--- /dev/null
+++ b/modules/prefer-plain/CMakeLists.txt
@@ -0,0 +1,27 @@
+set(extra_deps
+       evolution-mail
+       evolution-mail-formatter
+       evolution-shell
+)
+set(sources
+       e-mail-parser-prefer-plain.c
+       e-mail-parser-prefer-plain.h
+       e-mail-display-popup-prefer-plain.c
+       e-mail-display-popup-prefer-plain.h
+       evolution-module-prefer-plain.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-prefer-plain
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
+
+add_subdirectory(plugin)
diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c 
b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
index 21fc1ce..4d6c360 100644
--- a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
+++ b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
@@ -12,9 +12,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-display-popup-prefer-plain.h"
 #include "mail/e-mail-display-popup-extension.h"
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c 
b/modules/prefer-plain/e-mail-parser-prefer-plain.c
index 7908999..357473f 100644
--- a/modules/prefer-plain/e-mail-parser-prefer-plain.c
+++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c
@@ -12,9 +12,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/modules/prefer-plain/evolution-module-prefer-plain.c 
b/modules/prefer-plain/evolution-module-prefer-plain.c
index 59de774..bd9d9a8 100644
--- a/modules/prefer-plain/evolution-module-prefer-plain.c
+++ b/modules/prefer-plain/evolution-module-prefer-plain.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-parser-prefer-plain.h"
 #include "e-mail-display-popup-prefer-plain.h"
diff --git a/modules/prefer-plain/plugin/CMakeLists.txt b/modules/prefer-plain/plugin/CMakeLists.txt
new file mode 100644
index 0000000..b891e54
--- /dev/null
+++ b/modules/prefer-plain/plugin/CMakeLists.txt
@@ -0,0 +1,44 @@
+add_eplug_file(prefer-plain org-gnome-prefer-plain.eplug)
+
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       config-ui.c
+)
+
+add_library(org-gnome-prefer-plain MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-prefer-plain
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-prefer-plain PRIVATE
+       -DG_LOG_DOMAIN=\"prefer-plain\"
+)
+
+target_compile_options(org-gnome-prefer-plain PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-prefer-plain PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-prefer-plain
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-prefer-plain
+       DESTINATION ${plugindir}
+)
diff --git a/modules/prefer-plain/plugin/config-ui.c b/modules/prefer-plain/plugin/config-ui.c
index de30b42..ae7a3d2 100644
--- a/modules/prefer-plain/plugin/config-ui.c
+++ b/modules/prefer-plain/plugin/config-ui.c
@@ -13,9 +13,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/modules/settings/CMakeLists.txt b/modules/settings/CMakeLists.txt
new file mode 100644
index 0000000..5d6d38d
--- /dev/null
+++ b/modules/settings/CMakeLists.txt
@@ -0,0 +1,61 @@
+set(extra_deps
+       email-engine
+       evolution-calendar
+       evolution-mail
+       evolution-mail-formatter
+       evolution-shell
+)
+set(sources
+       evolution-module-settings.c
+       e-settings-cal-model.c
+       e-settings-cal-model.h
+       e-settings-calendar-item.c
+       e-settings-calendar-item.h
+       e-settings-calendar-view.c
+       e-settings-calendar-view.h
+       e-settings-client-cache.c
+       e-settings-client-cache.h
+       e-settings-date-edit.c
+       e-settings-date-edit.h
+       e-settings-deprecated.c
+       e-settings-deprecated.h
+       e-settings-content-editor.c
+       e-settings-content-editor.h
+       e-settings-mail-browser.c
+       e-settings-mail-browser.h
+       e-settings-mail-formatter.c
+       e-settings-mail-formatter.h
+       e-settings-mail-part-headers.c
+       e-settings-mail-part-headers.h
+       e-settings-mail-reader.c
+       e-settings-mail-reader.h
+       e-settings-mail-session.c
+       e-settings-mail-session.h
+       e-settings-meeting-store.c
+       e-settings-meeting-store.h
+       e-settings-meeting-time-selector.c
+       e-settings-meeting-time-selector.h
+       e-settings-message-list.c
+       e-settings-message-list.h
+       e-settings-name-selector-entry.c
+       e-settings-name-selector-entry.h
+       e-settings-spell-checker.c
+       e-settings-spell-checker.h
+       e-settings-spell-entry.c
+       e-settings-spell-entry.h
+       e-settings-weekday-chooser.c
+       e-settings-weekday-chooser.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-settings
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/settings/e-settings-cal-model.c b/modules/settings/e-settings-cal-model.c
index 19401cd..a6f10c8 100644
--- a/modules/settings/e-settings-cal-model.c
+++ b/modules/settings/e-settings-cal-model.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-cal-model.h"
 
diff --git a/modules/settings/e-settings-calendar-item.c b/modules/settings/e-settings-calendar-item.c
index 555b08a..7b9a280 100644
--- a/modules/settings/e-settings-calendar-item.c
+++ b/modules/settings/e-settings-calendar-item.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-calendar-item.h"
 
diff --git a/modules/settings/e-settings-calendar-view.c b/modules/settings/e-settings-calendar-view.c
index 4cacb34..4430cff 100644
--- a/modules/settings/e-settings-calendar-view.c
+++ b/modules/settings/e-settings-calendar-view.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-calendar-view.h"
 
diff --git a/modules/settings/e-settings-client-cache.c b/modules/settings/e-settings-client-cache.c
index df9c01b..e994404 100644
--- a/modules/settings/e-settings-client-cache.c
+++ b/modules/settings/e-settings-client-cache.c
@@ -15,7 +15,7 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
 
 #include "e-settings-client-cache.h"
 
diff --git a/modules/settings/e-settings-content-editor.c b/modules/settings/e-settings-content-editor.c
index 3bc438c..5cb43ad 100644
--- a/modules/settings/e-settings-content-editor.c
+++ b/modules/settings/e-settings-content-editor.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/modules/settings/e-settings-date-edit.c b/modules/settings/e-settings-date-edit.c
index f1c8f38..7d6d733 100644
--- a/modules/settings/e-settings-date-edit.c
+++ b/modules/settings/e-settings-date-edit.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-date-edit.h"
 
diff --git a/modules/settings/e-settings-mail-formatter.c b/modules/settings/e-settings-mail-formatter.c
index fb00016..bd12e20 100644
--- a/modules/settings/e-settings-mail-formatter.c
+++ b/modules/settings/e-settings-mail-formatter.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-mail-formatter.h"
 
diff --git a/modules/settings/e-settings-mail-reader.c b/modules/settings/e-settings-mail-reader.c
index 7d473ef..2875d0f 100644
--- a/modules/settings/e-settings-mail-reader.c
+++ b/modules/settings/e-settings-mail-reader.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-mail-reader.h"
 
diff --git a/modules/settings/e-settings-meeting-store.c b/modules/settings/e-settings-meeting-store.c
index a373e00..5259959 100644
--- a/modules/settings/e-settings-meeting-store.c
+++ b/modules/settings/e-settings-meeting-store.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-meeting-store.h"
 
diff --git a/modules/settings/e-settings-meeting-time-selector.c 
b/modules/settings/e-settings-meeting-time-selector.c
index 8e4a69f..77cf64d 100644
--- a/modules/settings/e-settings-meeting-time-selector.c
+++ b/modules/settings/e-settings-meeting-time-selector.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-meeting-time-selector.h"
 
diff --git a/modules/settings/e-settings-name-selector-entry.c 
b/modules/settings/e-settings-name-selector-entry.c
index 5d069d0..281472e 100644
--- a/modules/settings/e-settings-name-selector-entry.c
+++ b/modules/settings/e-settings-name-selector-entry.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-settings-name-selector-entry.h"
 
diff --git a/modules/settings/e-settings-weekday-chooser.c b/modules/settings/e-settings-weekday-chooser.c
index 3c66293..1fc161f 100644
--- a/modules/settings/e-settings-weekday-chooser.c
+++ b/modules/settings/e-settings-weekday-chooser.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <e-util/e-util.h>
 
diff --git a/modules/spamassassin/CMakeLists.txt b/modules/spamassassin/CMakeLists.txt
new file mode 100644
index 0000000..74d2587
--- /dev/null
+++ b/modules/spamassassin/CMakeLists.txt
@@ -0,0 +1,23 @@
+add_appdata_file(evolution-spamassassin.metainfo.xml.in evolution-spamassassin.metainfo.xml)
+
+set(extra_deps
+       email-engine
+       evolution-mail
+       evolution-shell
+)
+set(sources
+       evolution-spamassassin.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-spamassassin
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/spamassassin/evolution-spamassassin.c b/modules/spamassassin/evolution-spamassassin.c
index 47164c6..db354f6 100644
--- a/modules/spamassassin/evolution-spamassassin.c
+++ b/modules/spamassassin/evolution-spamassassin.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/wait.h>
diff --git a/modules/startup-wizard/CMakeLists.txt b/modules/startup-wizard/CMakeLists.txt
new file mode 100644
index 0000000..cb54eec
--- /dev/null
+++ b/modules/startup-wizard/CMakeLists.txt
@@ -0,0 +1,28 @@
+set(extra_deps
+       email-engine
+       evolution-calendar
+       evolution-mail
+       evolution-shell
+)
+set(sources
+       evolution-startup-wizard.c
+       e-startup-assistant.c
+       e-startup-assistant.h
+       e-mail-config-import-page.c
+       e-mail-config-import-page.h
+       e-mail-config-import-progress-page.c
+       e-mail-config-import-progress-page.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-startup-wizard
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/startup-wizard/e-mail-config-import-page.c 
b/modules/startup-wizard/e-mail-config-import-page.c
index c2e79aa..c81d425 100644
--- a/modules/startup-wizard/e-mail-config-import-page.c
+++ b/modules/startup-wizard/e-mail-config-import-page.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-config-import-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-config-import-page.h"
+
 #define E_MAIL_CONFIG_IMPORT_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_IMPORT_PAGE, EMailConfigImportPagePrivate))
diff --git a/modules/startup-wizard/e-mail-config-import-progress-page.c 
b/modules/startup-wizard/e-mail-config-import-progress-page.c
index c742bdb..5d19c82 100644
--- a/modules/startup-wizard/e-mail-config-import-progress-page.c
+++ b/modules/startup-wizard/e-mail-config-import-progress-page.c
@@ -15,11 +15,12 @@
  *
  */
 
-#include "e-mail-config-import-progress-page.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
+#include "e-mail-config-import-progress-page.h"
+
 #define E_MAIL_CONFIG_IMPORT_PROGRESS_PAGE_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_CONFIG_IMPORT_PROGRESS_PAGE, EMailConfigImportProgressPagePrivate))
diff --git a/modules/startup-wizard/e-startup-assistant.c b/modules/startup-wizard/e-startup-assistant.c
index 739c5ca..07b7dfb 100644
--- a/modules/startup-wizard/e-startup-assistant.c
+++ b/modules/startup-wizard/e-startup-assistant.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-startup-assistant.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n-lib.h>
 
 #include <e-util/e-util.h>
@@ -27,6 +26,8 @@
 #include "e-mail-config-import-page.h"
 #include "e-mail-config-import-progress-page.h"
 
+#include "e-startup-assistant.h"
+
 #define E_STARTUP_ASSISTANT_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_STARTUP_ASSISTANT, EStartupAssistantPrivate))
diff --git a/modules/startup-wizard/evolution-startup-wizard.c 
b/modules/startup-wizard/evolution-startup-wizard.c
index 60b8f45..2709f55 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <libebackend/libebackend.h>
diff --git a/modules/text-highlight/CMakeLists.txt b/modules/text-highlight/CMakeLists.txt
new file mode 100644
index 0000000..c463467
--- /dev/null
+++ b/modules/text-highlight/CMakeLists.txt
@@ -0,0 +1,29 @@
+set(extra_deps
+       evolution-mail
+       evolution-mail-formatter
+       evolution-shell
+)
+set(sources
+       e-mail-display-popup-text-highlight.c
+       e-mail-display-popup-text-highlight.h
+       e-mail-formatter-text-highlight.c
+       e-mail-formatter-text-highlight.h
+       e-mail-parser-text-highlight.c
+       e-mail-parser-text-highlight.h
+       evolution-module-text-highlight.c
+       languages.c
+       languages.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-text-highlight
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/text-highlight/e-mail-display-popup-text-highlight.c 
b/modules/text-highlight/e-mail-display-popup-text-highlight.c
index a28932e..646745a 100644
--- a/modules/text-highlight/e-mail-display-popup-text-highlight.c
+++ b/modules/text-highlight/e-mail-display-popup-text-highlight.c
@@ -12,9 +12,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-display-popup-text-highlight.h"
 #include "mail/e-mail-display-popup-extension.h"
diff --git a/modules/text-highlight/e-mail-formatter-text-highlight.c 
b/modules/text-highlight/e-mail-formatter-text-highlight.c
index 4eb1cbe..f1188ba 100644
--- a/modules/text-highlight/e-mail-formatter-text-highlight.c
+++ b/modules/text-highlight/e-mail-formatter-text-highlight.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-formatter-text-highlight.h"
 #include "languages.h"
diff --git a/modules/text-highlight/e-mail-parser-text-highlight.c 
b/modules/text-highlight/e-mail-parser-text-highlight.c
index f1acc97..277f683 100644
--- a/modules/text-highlight/e-mail-parser-text-highlight.c
+++ b/modules/text-highlight/e-mail-parser-text-highlight.c
@@ -12,9 +12,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/modules/text-highlight/languages.c b/modules/text-highlight/languages.c
index ef232a0..4571f2d 100644
--- a/modules/text-highlight/languages.c
+++ b/modules/text-highlight/languages.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "languages.h"
 
diff --git a/modules/tnef-attachment/CMakeLists.txt b/modules/tnef-attachment/CMakeLists.txt
new file mode 100644
index 0000000..afea03b
--- /dev/null
+++ b/modules/tnef-attachment/CMakeLists.txt
@@ -0,0 +1,24 @@
+set(extra_deps
+       evolution-mail
+       evolution-mail-formatter
+)
+set(sources
+       e-mail-parser-tnef-attachment.c
+       e-mail-parser-tnef-attachment.h
+       evolution-module-tnef-attachment.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags
+       ${TNEF_LDFLAGS}
+)
+
+add_evolution_module(module-tnef-attachment
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c 
b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
index b67f31f..ece7520 100644
--- a/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
+++ b/modules/tnef-attachment/e-mail-parser-tnef-attachment.c
@@ -12,9 +12,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-parser-tnef-attachment.h"
 
diff --git a/modules/vcard-inline/CMakeLists.txt b/modules/vcard-inline/CMakeLists.txt
new file mode 100644
index 0000000..64474f2
--- /dev/null
+++ b/modules/vcard-inline/CMakeLists.txt
@@ -0,0 +1,29 @@
+set(extra_deps
+       eabutil
+       eabwidgets
+       econtactprint
+       evolution-mail
+       evolution-mail-formatter
+)
+set(sources
+       e-mail-formatter-vcard.c
+       e-mail-formatter-vcard.h
+       e-mail-parser-vcard.c
+       e-mail-parser-vcard.h
+       e-mail-part-vcard.c
+       e-mail-part-vcard.h
+       evolution-module-vcard-inline.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-vcard-inline
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/vcard-inline/e-mail-formatter-vcard.c b/modules/vcard-inline/e-mail-formatter-vcard.c
index 40e573c..9f226e7 100644
--- a/modules/vcard-inline/e-mail-formatter-vcard.c
+++ b/modules/vcard-inline/e-mail-formatter-vcard.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-mail-formatter-vcard.h"
 #include "e-mail-part-vcard.h"
diff --git a/modules/vcard-inline/e-mail-parser-vcard.c b/modules/vcard-inline/e-mail-parser-vcard.c
index f1cf005..6ec7e1c 100644
--- a/modules/vcard-inline/e-mail-parser-vcard.c
+++ b/modules/vcard-inline/e-mail-parser-vcard.c
@@ -14,9 +14,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/modules/vcard-inline/e-mail-part-vcard.c b/modules/vcard-inline/e-mail-part-vcard.c
index f38d22f..db7e790 100644
--- a/modules/vcard-inline/e-mail-part-vcard.c
+++ b/modules/vcard-inline/e-mail-part-vcard.c
@@ -15,9 +15,8 @@
  *
  */
 
-#include "e-mail-part-vcard.h"
+#include "evolution-config.h"
 
-#include <config.h>
 #include <glib/gi18n.h>
 
 #include <em-format/e-mail-formatter-utils.h>
@@ -26,6 +25,8 @@
 #include <shell/e-shell.h>
 #include <addressbook/gui/widgets/eab-contact-merging.h>
 
+#include "e-mail-part-vcard.h"
+
 #define E_MAIL_PART_VCARD_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_MAIL_PART_VCARD, EMailPartVCardPrivate))
diff --git a/modules/webkit-editor/CMakeLists.txt b/modules/webkit-editor/CMakeLists.txt
new file mode 100644
index 0000000..e04f48e
--- /dev/null
+++ b/modules/webkit-editor/CMakeLists.txt
@@ -0,0 +1,25 @@
+set(extra_deps)
+set(sources
+       evolution-module-webkit-editor.c
+       e-webkit-editor-extension.c
+       e-webkit-editor-extension.h
+       e-webkit-editor.c
+       e-webkit-editor.h
+)
+set(extra_defines
+       -DEVOLUTION_WEB_EXTENSIONS_WEBKIT_EDITOR_DIR=\"${webextensionswebkiteditordir}\"
+)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-webkit-editor
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
+
+add_subdirectory(web-extension)
diff --git a/modules/webkit-editor/e-webkit-editor-extension.c 
b/modules/webkit-editor/e-webkit-editor-extension.c
index e05ee20..50b4973 100644
--- a/modules/webkit-editor/e-webkit-editor-extension.c
+++ b/modules/webkit-editor/e-webkit-editor-extension.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-webkit-editor-extension.h"
 #include "e-webkit-editor.h"
diff --git a/modules/webkit-editor/e-webkit-editor.c b/modules/webkit-editor/e-webkit-editor.c
index bdf2733..60a0619 100644
--- a/modules/webkit-editor/e-webkit-editor.c
+++ b/modules/webkit-editor/e-webkit-editor.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-webkit-editor.h"
 
diff --git a/modules/webkit-editor/evolution-module-webkit-editor.c 
b/modules/webkit-editor/evolution-module-webkit-editor.c
index 116903f..8225da3 100644
--- a/modules/webkit-editor/evolution-module-webkit-editor.c
+++ b/modules/webkit-editor/evolution-module-webkit-editor.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-webkit-editor-extension.h"
 
diff --git a/modules/webkit-editor/web-extension/CMakeLists.txt 
b/modules/webkit-editor/web-extension/CMakeLists.txt
new file mode 100644
index 0000000..b2ccdc8
--- /dev/null
+++ b/modules/webkit-editor/web-extension/CMakeLists.txt
@@ -0,0 +1,30 @@
+set(extra_deps)
+set(sources
+       e-composer-dom-functions.c
+       e-composer-dom-functions.h
+       e-dialogs-dom-functions.c
+       e-dialogs-dom-functions.h
+       e-editor-dom-functions.c
+       e-editor-dom-functions.h
+       e-editor-page.c
+       e-editor-page.h
+       e-editor-undo-redo-manager.c
+       e-editor-undo-redo-manager.h
+       e-editor-web-extension.c
+       e-editor-web-extension.h
+       e-editor-web-extension-main.c
+       e-editor-web-extension-names.h
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_webextension_editor_module(module-webkit-editor-webextension
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/webkit-editor/web-extension/e-composer-dom-functions.c 
b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
index 934e88c..4a6ab9e 100644
--- a/modules/webkit-editor/web-extension/e-composer-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-composer-dom-functions.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c 
b/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
index 82a38c2..b371a42 100644
--- a/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-dialogs-dom-functions.c
@@ -15,9 +15,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #define WEBKIT_DOM_USE_UNSTABLE_API
 #include <webkitdom/WebKitDOMDOMSelection.h>
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c 
b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index 1d32565..c61d365 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -14,9 +14,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/modules/webkit-editor/web-extension/e-editor-page.c 
b/modules/webkit-editor/web-extension/e-editor-page.c
index 0ed0cff..c3f1725 100644
--- a/modules/webkit-editor/web-extension/e-editor-page.c
+++ b/modules/webkit-editor/web-extension/e-editor-page.c
@@ -15,9 +15,7 @@
  * along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib.h>
 #include <webkit2/webkit-web-extension.h>
diff --git a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c 
b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
index 5082e6c..aa91537 100644
--- a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
+++ b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #define WEBKIT_DOM_USE_UNSTABLE_API
 #include <webkitdom/WebKitDOMDocumentFragmentUnstable.h>
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension-main.c 
b/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
index 244bc4c..7bbcc0d 100644
--- a/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
+++ b/modules/webkit-editor/web-extension/e-editor-web-extension-main.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <camel/camel.h>
 
diff --git a/modules/webkit-editor/web-extension/e-editor-web-extension.c 
b/modules/webkit-editor/web-extension/e-editor-web-extension.c
index 03b5194..7401947 100644
--- a/modules/webkit-editor/web-extension/e-editor-web-extension.c
+++ b/modules/webkit-editor/web-extension/e-editor-web-extension.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/modules/webkit-inspector/CMakeLists.txt b/modules/webkit-inspector/CMakeLists.txt
new file mode 100644
index 0000000..5b8bfbd
--- /dev/null
+++ b/modules/webkit-inspector/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(extra_deps)
+set(sources
+       evolution-webkit-inspector.c
+)
+set(extra_defines)
+set(extra_cflags)
+set(extra_incdirs)
+set(extra_ldflags)
+
+add_evolution_module(module-webkit-inspector
+       sources
+       extra_deps
+       extra_defines
+       extra_cflags
+       extra_incdirs
+       extra_ldflags
+)
diff --git a/modules/webkit-inspector/evolution-webkit-inspector.c 
b/modules/webkit-inspector/evolution-webkit-inspector.c
index 4c9a141..bb3fea8 100644
--- a/modules/webkit-inspector/evolution-webkit-inspector.c
+++ b/modules/webkit-inspector/evolution-webkit-inspector.c
@@ -15,7 +15,8 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
+
 #include <glib/gi18n-lib.h>
 #include <gdk/gdkkeysyms.h>
 
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
new file mode 100644
index 0000000..69239fa
--- /dev/null
+++ b/plugins/CMakeLists.txt
@@ -0,0 +1,3 @@
+foreach(plugin ${build_plugins})
+       add_subdirectory(${plugin})
+endforeach(plugin)
diff --git a/plugins/attachment-reminder/CMakeLists.txt b/plugins/attachment-reminder/CMakeLists.txt
new file mode 100644
index 0000000..17aa8a1
--- /dev/null
+++ b/plugins/attachment-reminder/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_error_files(attachment-reminder org-gnome-attachment-reminder.error)
+add_eplug_file(attachment-reminder org-gnome-evolution-attachment-reminder.eplug)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       attachment-reminder.c
+)
+
+add_library(org-gnome-evolution-attachment-reminder MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-evolution-attachment-reminder
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-evolution-attachment-reminder PRIVATE
+       -DG_LOG_DOMAIN=\"attachment-reminder\"
+)
+
+target_compile_options(org-gnome-evolution-attachment-reminder PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-evolution-attachment-reminder PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-evolution-attachment-reminder
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-evolution-attachment-reminder
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/attachment-reminder/attachment-reminder.c 
b/plugins/attachment-reminder/attachment-reminder.c
index aec294d..8436e52 100644
--- a/plugins/attachment-reminder/attachment-reminder.c
+++ b/plugins/attachment-reminder/attachment-reminder.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/plugins/bbdb/CMakeLists.txt b/plugins/bbdb/CMakeLists.txt
new file mode 100644
index 0000000..8ce6cfd
--- /dev/null
+++ b/plugins/bbdb/CMakeLists.txt
@@ -0,0 +1,52 @@
+add_eplug_file(bbdb org-gnome-evolution-bbdb.eplug)
+
+set(DEPENDENCIES
+       eabutil
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       bbdb.c
+       bbdb.h
+       gaimbuddies.c
+)
+
+add_library(org-gnome-evolution-bbdb MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-evolution-bbdb
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-evolution-bbdb PRIVATE
+       -DG_LOG_DOMAIN=\"bbdb\"
+)
+
+target_compile_options(org-gnome-evolution-bbdb PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-evolution-bbdb PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-evolution-bbdb
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-evolution-bbdb
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c
index 6e7582c..0b26fca 100644
--- a/plugins/bbdb/bbdb.c
+++ b/plugins/bbdb/bbdb.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c
index 5129583..d256255 100644
--- a/plugins/bbdb/gaimbuddies.c
+++ b/plugins/bbdb/gaimbuddies.c
@@ -28,9 +28,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <libxml/tree.h>
 #include <libxml/parser.h>
diff --git a/plugins/dbx-import/CMakeLists.txt b/plugins/dbx-import/CMakeLists.txt
new file mode 100644
index 0000000..ec908cc
--- /dev/null
+++ b/plugins/dbx-import/CMakeLists.txt
@@ -0,0 +1,47 @@
+add_eplug_file(dbx-import org-gnome-dbx-import.eplug)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-mail
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       dbx-importer.c
+)
+
+add_library(org-gnome-dbx-import MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-dbx-import
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-dbx-import PRIVATE
+       -DG_LOG_DOMAIN=\"dbx-import\"
+)
+
+target_compile_options(org-gnome-dbx-import PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-dbx-import PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-dbx-import
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-dbx-import
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c
index c338930..0fe66dc 100644
--- a/plugins/dbx-import/dbx-importer.c
+++ b/plugins/dbx-import/dbx-importer.c
@@ -28,11 +28,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define G_LOG_DOMAIN "eplugin-readdbx"
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/plugins/email-custom-header/CMakeLists.txt b/plugins/email-custom-header/CMakeLists.txt
new file mode 100644
index 0000000..a4a17f1
--- /dev/null
+++ b/plugins/email-custom-header/CMakeLists.txt
@@ -0,0 +1,54 @@
+add_eplug_file(email-custom-header org-gnome-email-custom-header.eplug)
+
+install(FILES org-gnome-email-custom-header.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       email-custom-header.c
+       email-custom-header.h
+)
+
+add_library(org-gnome-email-custom-header MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-email-custom-header
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-email-custom-header PRIVATE
+       -DG_LOG_DOMAIN=\"email-custom-header\"
+)
+
+target_compile_options(org-gnome-email-custom-header PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-email-custom-header PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-email-custom-header
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-email-custom-header
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/email-custom-header/email-custom-header.c 
b/plugins/email-custom-header/email-custom-header.c
index af5e258..e51445e 100644
--- a/plugins/email-custom-header/email-custom-header.c
+++ b/plugins/email-custom-header/email-custom-header.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/external-editor/CMakeLists.txt b/plugins/external-editor/CMakeLists.txt
new file mode 100644
index 0000000..06fe0a8
--- /dev/null
+++ b/plugins/external-editor/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_error_files(external-editor org-gnome-external-editor.error)
+add_eplug_file(external-editor org-gnome-external-editor.eplug)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       external-editor.c
+)
+
+add_library(org-gnome-external-editor MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-external-editor
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-external-editor PRIVATE
+       -DG_LOG_DOMAIN=\"external-editor\"
+)
+
+target_compile_options(org-gnome-external-editor PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-external-editor PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-external-editor
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-external-editor
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c
index 52f04bf..081ac6c 100644
--- a/plugins/external-editor/external-editor.c
+++ b/plugins/external-editor/external-editor.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 
diff --git a/plugins/face/CMakeLists.txt b/plugins/face/CMakeLists.txt
new file mode 100644
index 0000000..d9e2982
--- /dev/null
+++ b/plugins/face/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_error_files(face org-gnome-face.error)
+add_eplug_file(face org-gnome-face.eplug)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       face.c
+)
+
+add_library(org-gnome-face MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-face
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-face PRIVATE
+       -DG_LOG_DOMAIN=\"face\"
+)
+
+target_compile_options(org-gnome-face PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-face PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-face
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-face
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/face/face.c b/plugins/face/face.c
index 797e526..7953bfd 100644
--- a/plugins/face/face.c
+++ b/plugins/face/face.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "composer/e-msg-composer.h"
 #include <gtk/gtk.h>
diff --git a/plugins/mail-notification/CMakeLists.txt b/plugins/mail-notification/CMakeLists.txt
new file mode 100644
index 0000000..b597ec2
--- /dev/null
+++ b/plugins/mail-notification/CMakeLists.txt
@@ -0,0 +1,53 @@
+add_eplug_file(mail-notification org-gnome-mail-notification.eplug)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-mail
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       mail-notification.c
+)
+
+add_library(org-gnome-mail-notification MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-mail-notification
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mail-notification PRIVATE
+       -DG_LOG_DOMAIN=\"mail-notification\"
+)
+
+target_compile_options(org-gnome-mail-notification PUBLIC
+       ${CANBERRA_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(org-gnome-mail-notification PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CANBERRA_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mail-notification
+       ${DEPENDENCIES}
+       ${CANBERRA_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${LIBNOTIFY_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mail-notification
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index 5edbdb3..2a4f28f 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/mail-to-task/CMakeLists.txt b/plugins/mail-to-task/CMakeLists.txt
new file mode 100644
index 0000000..3f6f5ae
--- /dev/null
+++ b/plugins/mail-to-task/CMakeLists.txt
@@ -0,0 +1,49 @@
+add_eplug_file(mail-to-task org-gnome-mail-to-task.eplug)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-calendar
+       evolution-mail
+       evolution-mail-formatter
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       mail-to-task.c
+)
+
+add_library(org-gnome-mail-to-task MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-mail-to-task
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mail-to-task PRIVATE
+       -DG_LOG_DOMAIN=\"mail-to-task\"
+)
+
+target_compile_options(org-gnome-mail-to-task PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-mail-to-task PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mail-to-task
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mail-to-task
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index ef0fda4..527698c 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -23,9 +23,7 @@
 
 /* Convert a mail message into a task */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/plugins/mailing-list-actions/CMakeLists.txt b/plugins/mailing-list-actions/CMakeLists.txt
new file mode 100644
index 0000000..5cf7243
--- /dev/null
+++ b/plugins/mailing-list-actions/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_error_files(mailing-list-actions org-gnome-mailing-list-actions.error)
+add_eplug_file(mailing-list-actions org-gnome-mailing-list-actions.eplug)
+
+set(DEPENDENCIES
+       econtacteditor
+       econtactlisteditor
+       evolution-mail
+       evolution-mail-composer
+       evolution-mail-formatter
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       mailing-list-actions.c
+)
+
+add_library(org-gnome-mailing-list-actions MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-mailing-list-actions
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-mailing-list-actions PRIVATE
+       -DG_LOG_DOMAIN=\"mailing-list-actions\"
+)
+
+target_compile_options(org-gnome-mailing-list-actions PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-mailing-list-actions PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-mailing-list-actions
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-mailing-list-actions
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c 
b/plugins/mailing-list-actions/mailing-list-actions.c
index 58f58f6..9affe98 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <stdio.h>
 #include <string.h>
diff --git a/plugins/pst-import/CMakeLists.txt b/plugins/pst-import/CMakeLists.txt
new file mode 100644
index 0000000..da417f2
--- /dev/null
+++ b/plugins/pst-import/CMakeLists.txt
@@ -0,0 +1,51 @@
+add_eplug_file(pst-import org-gnome-pst-import.eplug)
+add_appdata_file(evolution-pst.metainfo.xml.in evolution-pst.metainfo.xml)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-mail
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       pst-importer.c
+)
+
+add_library(org-gnome-pst-import MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-pst-import
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-pst-import PRIVATE
+       -DG_LOG_DOMAIN=\"pst-import\"
+)
+
+target_compile_options(org-gnome-pst-import PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${LIBPST_CFLAGS}
+)
+
+target_include_directories(org-gnome-pst-import PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${LIBPST_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-pst-import
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${LIBPST_LDFLAGS}
+)
+
+install(TARGETS org-gnome-pst-import
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c
index 5aacb4b..fed8493 100644
--- a/plugins/pst-import/pst-importer.c
+++ b/plugins/pst-import/pst-importer.c
@@ -20,11 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define G_LOG_DOMAIN "eplugin-readpst"
+#include "evolution-config.h"
 
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/plugins/publish-calendar/CMakeLists.txt b/plugins/publish-calendar/CMakeLists.txt
new file mode 100644
index 0000000..1df3ab2
--- /dev/null
+++ b/plugins/publish-calendar/CMakeLists.txt
@@ -0,0 +1,61 @@
+add_eplug_file(publish-calendar org-gnome-publish-calendar.eplug)
+
+install(FILES publish-calendar.ui
+       DESTINATION ${uidir}
+)
+
+set(DEPENDENCIES
+       evolution-calendar
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       publish-calendar.c
+       publish-format-fb.c
+       publish-format-fb.h
+       publish-format-ical.c
+       publish-format-ical.h
+       publish-location.c
+       publish-location.h
+       url-editor-dialog.c
+       url-editor-dialog.h
+)
+
+add_library(org-gnome-publish-calendar MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-publish-calendar
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-publish-calendar PRIVATE
+       -DG_LOG_DOMAIN=\"publish-calendar\"
+)
+
+target_compile_options(org-gnome-publish-calendar PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${LIBNOTIFY_CFLAGS}
+)
+
+target_include_directories(org-gnome-publish-calendar PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${LIBNOTIFY_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-publish-calendar
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${LIBNOTIFY_LDFLAGS}
+)
+
+install(TARGETS org-gnome-publish-calendar
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index dfa4e17..a7affb4 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <gtk/gtk.h>
diff --git a/plugins/publish-calendar/publish-format-fb.c b/plugins/publish-calendar/publish-format-fb.c
index 2181193..fd486c2 100644
--- a/plugins/publish-calendar/publish-format-fb.c
+++ b/plugins/publish-calendar/publish-format-fb.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <time.h>
diff --git a/plugins/publish-calendar/publish-format-ical.c b/plugins/publish-calendar/publish-format-ical.c
index 3f06cdb..6075919 100644
--- a/plugins/publish-calendar/publish-format-ical.c
+++ b/plugins/publish-calendar/publish-format-ical.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c
index 8d9f91e..452a4c2 100644
--- a/plugins/publish-calendar/publish-location.c
+++ b/plugins/publish-calendar/publish-location.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "publish-location.h"
 
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 582e85d..2415806 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "url-editor-dialog.h"
 
diff --git a/plugins/save-calendar/CMakeLists.txt b/plugins/save-calendar/CMakeLists.txt
new file mode 100644
index 0000000..38e0d15
--- /dev/null
+++ b/plugins/save-calendar/CMakeLists.txt
@@ -0,0 +1,49 @@
+add_eplug_file(save-calendar org-gnome-save-calendar.eplug)
+
+set(DEPENDENCIES
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       save-calendar.c
+       ical-format.c
+       csv-format.c
+       rdf-format.c
+       format-handler.h
+)
+
+add_library(org-gnome-save-calendar MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-save-calendar
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-save-calendar PRIVATE
+       -DG_LOG_DOMAIN=\"save-calendar\"
+)
+
+target_compile_options(org-gnome-save-calendar PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-save-calendar PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-save-calendar
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-save-calendar
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c
index 1a1b163..9e7d29c 100644
--- a/plugins/save-calendar/csv-format.c
+++ b/plugins/save-calendar/csv-format.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/save-calendar/ical-format.c b/plugins/save-calendar/ical-format.c
index 8e3d64d..e42ae7f 100644
--- a/plugins/save-calendar/ical-format.c
+++ b/plugins/save-calendar/ical-format.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c
index 3365b48..ee6760a 100644
--- a/plugins/save-calendar/rdf-format.c
+++ b/plugins/save-calendar/rdf-format.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
@@ -235,7 +233,7 @@ do_save_calendar_rdf (FormatHandler *handler,
                xmlSetProp (fnode, (const guchar *)"xmlns:x-lic", (const guchar 
*)"http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#";);
 
                /* Not sure if it's correct like this */
-               xmlNewChild (fnode, NULL, (const guchar *)"prodid", (const guchar *)"-//" PACKAGE_STRING 
"//iCal 1.0//EN");
+               xmlNewChild (fnode, NULL, (const guchar *)"prodid", (const guchar *)"-//" PACKAGE " " VERSION 
VERSION_SUBSTRING " " VERSION_COMMENT "//iCal 1.0//EN");
 
                /* Assuming GREGORIAN is the only supported calendar scale */
                xmlNewChild (fnode, NULL, (const guchar *)"calscale", (const guchar *)"GREGORIAN");
diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c
index 723a1c2..3ee0f2e 100644
--- a/plugins/save-calendar/save-calendar.c
+++ b/plugins/save-calendar/save-calendar.c
@@ -22,9 +22,7 @@
 /* This is prototype code only, this may, or may not, use undocumented
  * unstable or private internal function calls. */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 #include <glib/gi18n.h>
diff --git a/plugins/templates/CMakeLists.txt b/plugins/templates/CMakeLists.txt
new file mode 100644
index 0000000..a357ea5
--- /dev/null
+++ b/plugins/templates/CMakeLists.txt
@@ -0,0 +1,50 @@
+add_eplug_file(templates org-gnome-templates.eplug)
+
+set(DEPENDENCIES
+       email-engine
+       evolution-mail
+       evolution-mail-composer
+       evolution-shell
+       evolution-util
+)
+
+set(SOURCES
+       templates.c
+       e-templates-store.h
+       e-templates-store.c
+)
+
+add_library(org-gnome-templates MODULE
+       ${SOURCES}
+)
+
+add_dependencies(org-gnome-templates
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(org-gnome-templates PRIVATE
+       -DG_LOG_DOMAIN=\"templates\"
+)
+
+target_compile_options(org-gnome-templates PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(org-gnome-templates PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(org-gnome-templates
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS org-gnome-templates
+       DESTINATION ${plugindir}
+)
diff --git a/plugins/templates/e-templates-store.c b/plugins/templates/e-templates-store.c
index dbae0ff..40b092f 100644
--- a/plugins/templates/e-templates-store.c
+++ b/plugins/templates/e-templates-store.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 3f98a6e..cdd6319 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -21,9 +21,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 0000000..9e81642
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1 @@
+intltool_setup_po_dir()
diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt
new file mode 100644
index 0000000..962941d
--- /dev/null
+++ b/shell/CMakeLists.txt
@@ -0,0 +1,221 @@
+glib_mkenums(e-shell-enumtypes e-shell.h E_SHELL_ENUMTYPES_H)
+add_error_files(shell shell.error)
+
+configure_file(evo-version.h.in
+       evo-version.h
+       @ONLY
+)
+
+# ******************************
+# evolution-shell library
+# ******************************
+
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       e-shell.c
+       e-shell-backend.c
+       e-shell-content.c
+       e-shell-enumtypes.c
+       e-shell-searchbar.c
+       e-shell-sidebar.c
+       e-shell-switcher.c
+       e-shell-taskbar.c
+       e-shell-utils.c
+       e-shell-view.c
+       e-shell-window.c
+       e-shell-window-private.c
+       e-shell-window-private.h
+       e-shell-migrate.c
+       e-shell-migrate.h
+       e-shell-window-actions.c
+       ${CMAKE_CURRENT_BINARY_DIR}/e-shell-enumtypes.c
+       ${CMAKE_CURRENT_BINARY_DIR}/evo-version.h
+)
+
+set(HEADERS
+       e-shell.h
+       e-shell-backend.h
+       e-shell-common.h
+       e-shell-content.h
+       e-shell-searchbar.h
+       e-shell-sidebar.h
+       e-shell-switcher.h
+       e-shell-taskbar.h
+       e-shell-utils.h
+       e-shell-view.h
+       e-shell-window.h
+       e-shell-window-actions.h
+       ${CMAKE_CURRENT_BINARY_DIR}/e-shell-enumtypes.h
+)
+
+add_library(evolution-shell SHARED
+       ${SOURCES}
+       ${HEADERS}
+)
+
+add_dependencies(evolution-shell
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-shell PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-shell\"
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+       -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+       -DEVOLUTION_ICONDIR=\"${icondir}\"
+       -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+       -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+)
+
+target_compile_options(evolution-shell PUBLIC
+       ${CLUTTER_GTK_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-shell PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CLUTTER_GTK_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-shell
+       ${DEPENDENCIES}
+       ${CLUTTER_GTK_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-shell
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES ${HEADERS}
+       DESTINATION ${privincludedir}/shell
+)
+
+# ******************************
+# evolution binary
+# ******************************
+
+set(DEPENDENCIES
+       evolution-util
+       evolution-shell
+)
+
+set(SOURCES
+       main.c
+       e-convert-local-mail.c
+       e-migrate-base-dirs.c
+)
+
+add_executable(evolution
+       ${SOURCES}
+)
+
+add_dependencies(evolution
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution PRIVATE
+       -DG_LOG_DOMAIN=\"evolution\"
+       -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       -DEVOLUTION_GALVIEWSDIR=\"${viewsdir}\"
+       -DEVOLUTION_HELPDIR=\"${evolutionhelpdir}\"
+       -DEVOLUTION_ICONDIR=\"${icondir}\"
+       -DEVOLUTION_MODULEDIR=\"${moduledir}\"
+       -DEVOLUTION_RULEDIR=\"${privdatadir}\"
+       -DEVOLUTION_TOOLSDIR=\"${privlibexecdir}\"
+)
+
+target_compile_options(evolution PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${CLUTTER_GTK_CFLAGS}
+)
+
+target_include_directories(evolution PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${CLUTTER_GTK_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${CLUTTER_GTK_LDFLAGS}
+)
+
+if(WIN32)
+       find_program(WINDRES windres)
+       if(WINDRES)
+               add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+                       COMMAND ${WINDRES} ${CMAKE_CURRENT_SOURCE_DIR}/evolution-icon.rc 
${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+                       DEPENDS evolution-icon.rc
+                               evolution.ico
+                               evolution-mail.ico
+                               evolution-memos.ico
+                               evolution-tasks.ico
+               )
+
+               target_link_libraries(evolution
+                       ${CMAKE_CURRENT_BINARY_DIR}/evolution-icon.o
+               )
+       endif(WINDRES)
+endif(WIN32)
+
+install(TARGETS evolution
+       DESTINATION ${BIN_INSTALL_DIR}
+)
+
+# ******************************
+# killev binary
+# ******************************
+
+if(NOT WIN32)
+       set(SOURCES
+               killev.c
+       )
+
+       add_executable(killev
+               ${SOURCES}
+       )
+
+       target_compile_definitions(killev PRIVATE
+               -DG_LOG_DOMAIN=\"killev\"
+               -DEVOLUTION_LOCALEDIR=\"${LOCALE_INSTALL_DIR}\"
+       )
+
+       target_compile_options(killev PUBLIC
+               ${EVOLUTION_DATA_SERVER_CFLAGS}
+               ${GNOME_PLATFORM_CFLAGS}
+       )
+
+       target_include_directories(killev PUBLIC
+               ${CMAKE_BINARY_DIR}
+               ${CMAKE_SOURCE_DIR}
+               ${CMAKE_CURRENT_BINARY_DIR}
+               ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+               ${GNOME_PLATFORM_INCLUDE_DIRS}
+       )
+
+       target_link_libraries(killev
+               ${DEPENDENCIES}
+               ${EVOLUTION_DATA_SERVER_LDFLAGS}
+               ${GNOME_PLATFORM_LDFLAGS}
+       )
+
+       install(TARGETS killev
+               DESTINATION ${privlibexecdir}
+       )
+endif(NOT WIN32)
diff --git a/shell/e-convert-local-mail.c b/shell/e-convert-local-mail.c
index cd6ec91..3a14d49 100644
--- a/shell/e-convert-local-mail.c
+++ b/shell/e-convert-local-mail.c
@@ -15,9 +15,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <glib/gstdio.h>
diff --git a/shell/e-shell-backend.c b/shell/e-shell-backend.c
index a0b0e59..01b4fc0 100644
--- a/shell/e-shell-backend.c
+++ b/shell/e-shell-backend.c
@@ -26,9 +26,7 @@
  * @include: shell/e-shell-backend.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-backend.h"
 
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 8509668..88a7fe7 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-content.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-content.h"
 
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index 5aa3efa..7f7f6f1 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <errno.h>
 #include <glib/gstdio.h>
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index 00073a0..4de9470 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-searchbar.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-searchbar.h"
 
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c
index 1683cf6..4d83e5b 100644
--- a/shell/e-shell-sidebar.c
+++ b/shell/e-shell-sidebar.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-sidebar.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-sidebar.h"
 
diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c
index a4f0271..31d46fe 100644
--- a/shell/e-shell-switcher.c
+++ b/shell/e-shell-switcher.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-switcher.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-switcher.h"
 
diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c
index 5138478..04194b1 100644
--- a/shell/e-shell-taskbar.c
+++ b/shell/e-shell-taskbar.c
@@ -24,15 +24,13 @@
  * @include: shell/e-shell-taskbar.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-taskbar.h"
 
 #include <libebackend/libebackend.h>
 
-#include <e-shell-view.h>
+#include "e-shell-view.h"
 
 #define E_SHELL_TASKBAR_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c
index 7b493e4..15efc5e 100644
--- a/shell/e-shell-utils.c
+++ b/shell/e-shell-utils.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-utils.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n-lib.h>
 
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index f7a5d06..cfb3c25 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-view.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-view.h"
 
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index c1db9c6..e15370d 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-window-private.h"
 
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index 2de82b6..1910ae3 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -18,9 +18,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-window-private.h"
 
diff --git a/shell/e-shell-window-private.h b/shell/e-shell-window-private.h
index f761fb8..68d0832 100644
--- a/shell/e-shell-window-private.h
+++ b/shell/e-shell-window-private.h
@@ -28,13 +28,13 @@
 
 #include <libebackend/libebackend.h>
 
-#include <e-shell.h>
-#include <e-shell-content.h>
-#include <e-shell-view.h>
-#include <e-shell-searchbar.h>
-#include <e-shell-switcher.h>
-#include <e-shell-window-actions.h>
-#include <e-shell-utils.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-content.h"
+#include "shell/e-shell-view.h"
+#include "shell/e-shell-searchbar.h"
+#include "shell/e-shell-switcher.h"
+#include "shell/e-shell-window-actions.h"
+#include "shell/e-shell-utils.h"
 
 #define E_SHELL_WINDOW_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 0fe229f..b063a40 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell-window.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell-window-private.h"
 
diff --git a/shell/e-shell.c b/shell/e-shell.c
index c3d0be6..e6bf94a 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -24,9 +24,7 @@
  * @include: shell/e-shell.h
  **/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-shell.h"
 
diff --git a/shell/evo-version.h.in b/shell/evo-version.h.in
index 2a49b20..1c5b50e 100644
--- a/shell/evo-version.h.in
+++ b/shell/evo-version.h.in
@@ -22,8 +22,8 @@
  * If a need arises to make this header public, expand the
  * API to mimic libedataserver/eds-version.h. */
 
-#define EVO_MAJOR_VERSION @EVO_MAJOR_VERSION@
-#define EVO_MINOR_VERSION @EVO_MINOR_VERSION@
-#define EVO_MICRO_VERSION @EVO_MICRO_VERSION@
+#define EVO_MAJOR_VERSION @PROJECT_VERSION_MAJOR@
+#define EVO_MINOR_VERSION @PROJECT_VERSION_MINOR@
+#define EVO_MICRO_VERSION @PROJECT_VERSION_PATCH@
 
 #endif /* EVO_VERSION_H */
diff --git a/shell/killev.c b/shell/killev.c
index 8e0e77a..4af9df1 100644
--- a/shell/killev.c
+++ b/shell/killev.c
@@ -18,7 +18,7 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
 
 #include <signal.h>
 #include <stdlib.h>
@@ -161,17 +161,17 @@ main (gint argc,
        g_object_unref (monitor);
 
 kill:
-#ifdef KILL_PROCESS_CMD
-       if (system (KILL_PROCESS_CMD " -QUIT evolution 2> /dev/null") == -1)
-               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_CMD);
-       if (system (KILL_PROCESS_CMD " -TERM evolution-alarm-notify 2> /dev/null") == -1)
-               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_CMD);
-       if (system (KILL_PROCESS_CMD " -QUIT evolution-source-registry 2> /dev/null") == -1)
-               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_CMD);
-       if (system (KILL_PROCESS_CMD " -QUIT evolution-addressbook-factory 2> /dev/null") == -1)
-               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_CMD);
-       if (system (KILL_PROCESS_CMD " -QUIT evolution-calendar-factory 2> /dev/null") == -1)
-               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_CMD);
+#ifdef KILL_PROCESS_COMMAND
+       if (system (KILL_PROCESS_COMMAND " -QUIT evolution 2> /dev/null") == -1)
+               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_COMMAND);
+       if (system (KILL_PROCESS_COMMAND " -TERM evolution-alarm-notify 2> /dev/null") == -1)
+               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_COMMAND);
+       if (system (KILL_PROCESS_COMMAND " -QUIT evolution-source-registry 2> /dev/null") == -1)
+               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_COMMAND);
+       if (system (KILL_PROCESS_COMMAND " -QUIT evolution-addressbook-factory 2> /dev/null") == -1)
+               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_COMMAND);
+       if (system (KILL_PROCESS_COMMAND " -QUIT evolution-calendar-factory 2> /dev/null") == -1)
+               g_warning ("%s: Failed to execute: '%s'", G_STRFUNC, KILL_PROCESS_COMMAND);
 #else
        g_printerr ("No \"kill\" command available.\n");
 #endif
diff --git a/shell/main.c b/shell/main.c
index f472b2c..276ec62 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -19,7 +19,7 @@
  *
  */
 
-#include <config.h>
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
@@ -29,7 +29,7 @@
 #include <glib-unix.h>
 #endif
 
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
 #include <clutter-gtk/clutter-gtk.h>
 #endif
 
@@ -290,7 +290,7 @@ option_version_cb (const gchar *option_name,
                    gpointer data,
                    GError **error)
 {
-       g_print ("%s\n", PACKAGE_STRING);
+       g_print ("%s %s%s %s\n", PACKAGE, VERSION, VERSION_SUBSTRING, VERSION_COMMENT);
 
        exit (0);
 }
@@ -459,7 +459,7 @@ main (gint argc,
        tzset ();
 
        /* The contact maps feature uses clutter-gtk. */
-#ifdef WITH_CONTACT_MAPS
+#ifdef ENABLE_CONTACT_MAPS
        /* XXX This function is declared in gtk-clutter-util.h with an
         *     unnecessary G_GNUC_WARN_UNUSED_RESULT attribute.  But we
         *     don't need the returned error code because we're checking
@@ -473,7 +473,7 @@ main (gint argc,
                &argc, &argv,
                _("- The Evolution PIM and Email Client"),
                entries, (gchar *) GETTEXT_PACKAGE, &error);
-#endif /* WITH_CONTACT_MAPS */
+#endif /* ENABLE_CONTACT_MAPS */
 
        if (error != NULL) {
                g_printerr ("%s\n", error->message);
diff --git a/smime/CMakeLists.txt b/smime/CMakeLists.txt
new file mode 100644
index 0000000..bd5d122
--- /dev/null
+++ b/smime/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(gui)
+add_subdirectory(lib)
diff --git a/smime/gui/CMakeLists.txt b/smime/gui/CMakeLists.txt
new file mode 100644
index 0000000..55a5745
--- /dev/null
+++ b/smime/gui/CMakeLists.txt
@@ -0,0 +1,61 @@
+set(DEPENDENCIES
+       evolution-shell
+       evolution-util
+       essmime
+)
+
+set(SOURCES
+       ca-trust-dialog.c
+       ca-trust-dialog.h
+       cert-trust-dialog.c
+       cert-trust-dialog.h
+       certificate-manager.c
+       certificate-manager.h
+       e-cert-selector.c
+       e-cert-selector.h
+       component.c
+       component.h
+)
+
+add_library(evolution-smime SHARED
+       ${SOURCES}
+)
+
+add_dependencies(evolution-smime
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(evolution-smime PRIVATE
+       -DG_LOG_DOMAIN=\"evolution-smime\"
+)
+
+target_compile_options(evolution-smime PUBLIC
+       ${CERT_UI_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(evolution-smime PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}/smime/lib
+       ${CERT_UI_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(evolution-smime
+       ${DEPENDENCIES}
+       ${CERT_UI_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS evolution-smime
+       DESTINATION ${privsolibdir}
+)
+
+install(FILES smime-ui.ui
+       DESTINATION ${uidir}
+)
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c
index 611c958..5955e8a 100644
--- a/smime/gui/ca-trust-dialog.c
+++ b/smime/gui/ca-trust-dialog.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "ca-trust-dialog.h"
 #include "certificate-manager.h"
diff --git a/smime/gui/cert-trust-dialog.c b/smime/gui/cert-trust-dialog.c
index 061cf90..82358fa 100644
--- a/smime/gui/cert-trust-dialog.c
+++ b/smime/gui/cert-trust-dialog.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "e-cert.h"
 #include "e-cert-trust.h"
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index 66c36d4..70764d3 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 
diff --git a/smime/gui/component.c b/smime/gui/component.c
index 11682ef..3b39383 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -19,9 +19,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include "component.h"
 
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c
index f18abd2..77e492b 100644
--- a/smime/gui/e-cert-selector.c
+++ b/smime/gui/e-cert-selector.c
@@ -20,9 +20,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <glib/gi18n.h>
 
diff --git a/smime/lib/CMakeLists.txt b/smime/lib/CMakeLists.txt
new file mode 100644
index 0000000..bb12741
--- /dev/null
+++ b/smime/lib/CMakeLists.txt
@@ -0,0 +1,52 @@
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       e-cert.c
+       e-cert.h
+       e-cert-trust.c
+       e-cert-trust.h
+       e-cert-db.c
+       e-cert-db.h
+       e-pkcs12.c
+       e-pkcs12.h
+)
+
+add_library(essmime SHARED
+       ${SOURCES}
+)
+
+add_dependencies(essmime
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(essmime PRIVATE
+       -DG_LOG_DOMAIN=\"essmime\"
+)
+
+target_compile_options(essmime PUBLIC
+       ${CERT_UI_CFLAGS}
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(essmime PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${CERT_UI_INCLUDE_DIRS}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(essmime
+       ${DEPENDENCIES}
+       ${CERT_UI_LDFLAGS}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS essmime
+       DESTINATION ${privsolibdir}
+)
diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c
index 237c912..bfd2024 100644
--- a/smime/lib/e-cert-db.c
+++ b/smime/lib/e-cert-db.c
@@ -40,9 +40,8 @@
  *
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
diff --git a/smime/lib/e-cert-trust.c b/smime/lib/e-cert-trust.c
index 54f092d..fd3174c 100644
--- a/smime/lib/e-cert-trust.c
+++ b/smime/lib/e-cert-trust.c
@@ -39,9 +39,8 @@
  *
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include "e-cert-trust.h"
 
diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c
index 3bc4a9b..002e967 100644
--- a/smime/lib/e-cert.c
+++ b/smime/lib/e-cert.c
@@ -39,9 +39,8 @@
  *
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include <time.h>
 
diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c
index 464fa81..79bf425 100644
--- a/smime/lib/e-pkcs12.c
+++ b/smime/lib/e-pkcs12.c
@@ -39,9 +39,8 @@
  *
  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include "evolution-config.h"
 
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
diff --git a/sounds/CMakeLists.txt b/sounds/CMakeLists.txt
new file mode 100644
index 0000000..c80e758
--- /dev/null
+++ b/sounds/CMakeLists.txt
@@ -0,0 +1,3 @@
+install(FILES default_alarm.wav
+       DESTINATION ${soundsdir}
+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..ce00177
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(BEHAVE_INSTALLED_TESTS
+       addressbook_contacts
+       contacts_shortcuts
+       general_shortcuts
+       mail_shortcuts
+       memos_shortcuts
+       view_shortcuts
+)
+
+install_behave_tests_if_enabled(BEHAVE_INSTALLED_TESTS session-exclusive "")
diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt
new file mode 100644
index 0000000..996d072
--- /dev/null
+++ b/ui/CMakeLists.txt
@@ -0,0 +1,9 @@
+install(FILES  evolution-calendars.ui
+               evolution-contacts.ui
+               evolution-mail.ui
+               evolution-mail-reader.ui
+               evolution-memos.ui
+               evolution-shell.ui
+               evolution-tasks.ui
+       DESTINATION ${uidir}
+)
diff --git a/views/CMakeLists.txt b/views/CMakeLists.txt
new file mode 100644
index 0000000..0f8a14a
--- /dev/null
+++ b/views/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_subdirectory(addressbook)
+add_subdirectory(calendar)
+add_subdirectory(mail)
+add_subdirectory(memos)
+add_subdirectory(tasks)
diff --git a/views/addressbook/CMakeLists.txt b/views/addressbook/CMakeLists.txt
new file mode 100644
index 0000000..d69c2d8
--- /dev/null
+++ b/views/addressbook/CMakeLists.txt
@@ -0,0 +1,6 @@
+install(FILES  Address_Cards.galview
+               By_Company.galview
+               Phone_List.galview
+               galview.xml
+       DESTINATION ${viewsdir}/addressbook
+)
diff --git a/views/calendar/CMakeLists.txt b/views/calendar/CMakeLists.txt
new file mode 100644
index 0000000..906a2c2
--- /dev/null
+++ b/views/calendar/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(FILES  List_View.galview
+               galview.xml
+       DESTINATION ${viewsdir}/calendar
+)
diff --git a/views/mail/CMakeLists.txt b/views/mail/CMakeLists.txt
new file mode 100644
index 0000000..e38ec10
--- /dev/null
+++ b/views/mail/CMakeLists.txt
@@ -0,0 +1,11 @@
+install(FILES  As_Sent_Folder.galview
+               By_Follow_Up_Flag.galview
+               By_Sender.galview
+               By_Status.galview
+               By_Subject.galview
+               Messages.galview
+               Wide_View_Normal.galview
+               Wide_View_Sent.galview
+               galview.xml
+       DESTINATION ${viewsdir}/mail
+)
diff --git a/views/memos/CMakeLists.txt b/views/memos/CMakeLists.txt
new file mode 100644
index 0000000..457418e
--- /dev/null
+++ b/views/memos/CMakeLists.txt
@@ -0,0 +1,4 @@
+install(FILES  Memos.galview
+               galview.xml
+       DESTINATION ${viewsdir}/memos
+)
diff --git a/views/tasks/CMakeLists.txt b/views/tasks/CMakeLists.txt
new file mode 100644
index 0000000..1e70f00
--- /dev/null
+++ b/views/tasks/CMakeLists.txt
@@ -0,0 +1,6 @@
+install(FILES  Tasks.galview
+               With_DueDate.galview
+               With_Status.galview
+               galview.xml
+       DESTINATION ${viewsdir}/tasks
+)
diff --git a/web-extensions/CMakeLists.txt b/web-extensions/CMakeLists.txt
new file mode 100644
index 0000000..ae39bff
--- /dev/null
+++ b/web-extensions/CMakeLists.txt
@@ -0,0 +1,92 @@
+set(DEPENDENCIES
+       evolution-util
+)
+
+set(SOURCES
+       e-dom-utils.h
+       e-dom-utils.c
+)
+
+add_library(edomutils SHARED
+       ${SOURCES}
+)
+
+add_dependencies(edomutils
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(edomutils PRIVATE
+       -DG_LOG_DOMAIN=\"edomutils\"
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+)
+
+target_compile_options(edomutils PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+)
+
+target_include_directories(edomutils PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+)
+
+target_link_libraries(edomutils
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+)
+
+install(TARGETS edomutils
+       DESTINATION ${privsolibdir}
+)
+
+set(SOURCES
+       e-web-extension.h
+       e-web-extension-names.h
+       e-dom-utils.h
+       e-web-extension.c
+       e-web-extension-main.c
+       e-dom-utils.c
+)
+
+add_library(ewebextension MODULE
+       ${SOURCES}
+)
+
+add_dependencies(ewebextension
+       ${DEPENDENCIES}
+)
+
+target_compile_definitions(ewebextension PRIVATE
+       -DG_LOG_DOMAIN=\"ewebextension\"
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"
+)
+
+target_compile_options(ewebextension PUBLIC
+       ${EVOLUTION_DATA_SERVER_CFLAGS}
+       ${GNOME_PLATFORM_CFLAGS}
+       ${WEB_EXTENSIONS_CFLAGS}
+)
+
+target_include_directories(ewebextension PUBLIC
+       ${CMAKE_BINARY_DIR}
+       ${CMAKE_SOURCE_DIR}
+       ${CMAKE_CURRENT_BINARY_DIR}
+       ${EVOLUTION_DATA_SERVER_INCLUDE_DIRS}
+       ${GNOME_PLATFORM_INCLUDE_DIRS}
+       ${WEB_EXTENSIONS_INCLUDE_DIRS}
+)
+
+target_link_libraries(ewebextension
+       ${DEPENDENCIES}
+       ${EVOLUTION_DATA_SERVER_LDFLAGS}
+       ${GNOME_PLATFORM_LDFLAGS}
+       ${WEB_EXTENSIONS_LDFLAGS}
+)
+
+install(TARGETS ewebextension
+       DESTINATION ${webextensionsdir}
+)
diff --git a/web-extensions/e-dom-utils.c b/web-extensions/e-dom-utils.c
index 5782c74..4d790ca 100644
--- a/web-extensions/e-dom-utils.c
+++ b/web-extensions/e-dom-utils.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 
diff --git a/web-extensions/e-web-extension-main.c b/web-extensions/e-web-extension-main.c
index 1525638..24bb6a9 100644
--- a/web-extensions/e-web-extension-main.c
+++ b/web-extensions/e-web-extension-main.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <camel/camel.h>
 
diff --git a/web-extensions/e-web-extension.c b/web-extensions/e-web-extension.c
index 1cc24d2..d053d2e 100644
--- a/web-extensions/e-web-extension.c
+++ b/web-extensions/e-web-extension.c
@@ -16,9 +16,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "evolution-config.h"
 
 #include <string.h>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]