Update Belarusian translation
[evolution.git] / help / CMakeLists.txt
blobe1cc16a7c50e1b6cd75d74a68681bd93a55218ba
1 set(HELP_ID ${PROJECT_NAME})
3 set(HELP_FIGURES_DIR figures)
5 set(HELP_MEDIA
6         ${HELP_FIGURES_DIR}/color-000000.png
7         ${HELP_FIGURES_DIR}/color-204a87.png
8         ${HELP_FIGURES_DIR}/color-2e3436.png
9         ${HELP_FIGURES_DIR}/color-4e9a06.png
10         ${HELP_FIGURES_DIR}/color-5c3566.png
11         ${HELP_FIGURES_DIR}/color-8f5902.png
12         ${HELP_FIGURES_DIR}/color-a40000.png
13         ${HELP_FIGURES_DIR}/color-c4a000.png
14         ${HELP_FIGURES_DIR}/color-ce5c00.png
15         ${HELP_FIGURES_DIR}/evolutionlogo.png
16         ${HELP_FIGURES_DIR}/html-composer-insert-image.png
17         ${HELP_FIGURES_DIR}/html-composer-insert-link.png
18         ${HELP_FIGURES_DIR}/html-composer-insert-rule.png
19         ${HELP_FIGURES_DIR}/html-composer-insert-table.png
20         ${HELP_FIGURES_DIR}/minus-icon.png
21         ${HELP_FIGURES_DIR}/new-mail-notification.png
22         ${HELP_FIGURES_DIR}/new-mail-switcher.png
23         ${HELP_FIGURES_DIR}/plus-icon.png
24         ${HELP_FIGURES_DIR}/search-icon.png
25         ${HELP_FIGURES_DIR}/window-overview-layers.png
28 set(HELP_FILES
29         backup-restore.page
30         calendar-alarms-and-reminders.page
31         calendar-caldav.page
32         calendar-classifications.page
33         calendar-free-busy.page
34         calendar-google.page
35         calendar-layout-appointment-display.page
36         calendar-layout-general-formatting.page
37         calendar-layout.page
38         calendar-layout-views.page
39         calendar-local.page
40         calendar-marcus-bains-line.page
41         calendar-meetings-delegating.page
42         calendar-meetings.page
43         calendar-meetings-replying-to-invitation.page
44         calendar-meetings-sending-invitation.page
45         calendar-organizing.page
46         calendar-publishing.page
47         calendar-recurrence.page
48         calendar-searching.page
49         calendar-sharing-information.page
50         calendar-timezones.page
51         calendar-usage-add-appointment.page
52         calendar-usage-delete-appointment.page
53         calendar-usage-edit-appointment.page
54         calendar-usage.page
55         calendar-using-several-calendars.page
56         calendar-weather.page
57         calendar-webdav.page
58         change-switcher-appearance.page
59         contacts-add-automatically.page
60         contacts-autocompletion.page
61         contacts-google.page
62         contacts-ldap.page
63         contacts-libreoffice.page
64         contacts-local.page
65         contacts-organizing.page
66         contacts-searching.page
67         contacts-usage-add-contact.page
68         contacts-usage-delete-contact.page
69         contacts-usage-edit-contact.page
70         contacts-usage.page
71         contacts-using-contact-lists.page
72         contacts-using-several-addressbooks.page
73         credits.page
74         data-storage.page
75         default-browser.page
76         deleting-appointments.page
77         deleting-emails.page
78         deleting-to-free-disk-space.page
79         exchange-connectors-overview.page
80         exchange-placeholder.page
81         exporting-data-calendar.page
82         exporting-data-contacts.page
83         exporting-data-mail.page
84         exporting-data.page
85         google-services.page
86         import-apps-mozilla.page
87         import-apps-outlook.page
88         import-data.page
89         import-single-files.page
90         import-supported-file-formats.page
91         index.page
92         intro-application.page
93         intro-first-run.page
94         intro-main-window.page
95         legal.xml
96         mail-access-gmail-imap-account.page
97         mail-access-gmail-pop-account.page
98         mail-account-manage-imap-plus.page
99         mail-account-manage-local-delivery.page
100         mail-account-manage-maildir-format-directories.page
101         mail-account-management.page
102         mail-account-manage-mh-format-directories.page
103         mail-account-manage-microsoft-exchange-evo-ews.page
104         mail-account-manage-microsoft-exchange-evo-mapi.page
105         mail-account-manage-microsoft-exchange.page
106         mail-account-manage-pop.page
107         mail-account-manage-unix-mbox-spool-directory.page
108         mail-account-manage-unix-mbox-spool-file.page
109         mail-account-manage-usenet-news.page
110         mail-attachments.page
111         mail-attachments-received.page
112         mail-attachments-sending.page
113         mail-calendar-sending-invitations.page
114         mail-cannot-see.page
115         mail-change-columns-in-message-list.page
116         mail-change-time-format.page
117         mail-composer-change-quotation-string.page
118         mail-composer-custom-header-lines.page
119         mail-composer-enable-html-format.page
120         mail-composer-external-editor.page
121         mail-composer-forward.page
122         mail-composer-forward-as-attachment.page
123         mail-composer-from-field-override.page
124         mail-composer-html-image.page
125         mail-composer-html-link.page
126         mail-composer-html.page
127         mail-composer-html-rule.page
128         mail-composer-html-table.page
129         mail-composer-html-text.page
130         mail-composer-mail-signatures-manage.page
131         mail-composer-mail-signatures.page
132         mail-composer-mail-signatures-per-account.page
133         mail-composer-message-templates.page
134         mail-composer-message-templates-reply.page
135         mail-composer-message-templates-save.page
136         mail-composer-message-templates-variables.page
137         mail-composer-plain-text.page
138         mail-composer-priority.page
139         mail-composer-reply.page
140         mail-composer-search.page
141         mail-composer-send-account-overrides.page
142         mail-composer-several-recipients.page
143         mail-composer-spellcheck.page
144         mail-composer-write-new-message.page
145         mail-default-CC-and-BCC.page
146         mail-default-folder-locations.page
147         mail-delete-and-undelete.page
148         mail-displaying-character-encodings.page
149         mail-displaying-collapsible-headers.page
150         mail-displaying-images-in-html.page
151         mail-displaying-message.page
152         mail-displaying-sender-photograph.page
153         mail-display-message-source.page
154         mail-duplicates.page
155         mail-encryption-gpg-create-key.page
156         mail-encryption-gpg-decrypting.page
157         mail-encryption-gpg-getting-keys.page
158         mail-encryption-gpg-set-up.page
159         mail-encryption-gpg-signing-encrypting.page
160         mail-encryption.page
161         mail-encryption-s-mime-manage.page
162         mail-encryption-s-mime-signing-encrypting.page
163         mail-filters-actions.page
164         mail-filters-conditions.page
165         mail-filters-not-working.page
166         mail-filters.page
167         mail-folders.page
168         mail-follow-up-flag.page
169         mail-imap-subscriptions.page
170         mail-labels.page
171         mail-layout-changing.page
172         mail-localized-re-subjects.page
173         mail-moving-emails.page
174         mail-not-sent.page
175         mail-organizing.page
176         mail-reading-keyboard-shortcuts.page
177         mail-read-receipts.page
178         mail-received-notification.page
179         mail-receiving-options-exchange-ews.page
180         mail-receiving-options-exchange-mapi.page
181         mail-receiving-options-imap-plus.page
182         mail-receiving-options-local-delivery.page
183         mail-receiving-options-maildir-format-directories.page
184         mail-receiving-options-mh-format-directories.page
185         mail-receiving-options.page
186         mail-receiving-options-pop.page
187         mail-receiving-options-unix-mbox-spool-directory.page
188         mail-receiving-options-unix-mbox-spool-file.page
189         mail-receiving-options-usenet-news.page
190         mail-recognized-thread-related-headers.page
191         mail-refresh-folders.page
192         mail-save-as-pdf.page
193         mail-search-folders-add.page
194         mail-search-folders-conditions.page
195         mail-search-folders-enable.page
196         mail-search-folders.page
197         mail-search-folders-refresh.page
198         mail-searching-attachment-type.page
199         mail-searching.page
200         mail-send-and-receive-automatically.page
201         mail-send-and-receive-manual.page
202         mail-send-and-receive.page
203         mail-sending-options-smtp.page
204         mail-several-pop-accounts.page
205         mail-sorting-message-list.page
206         mail-spam-marking.page
207         mail-spam.page
208         mail-spam-settings.page
209         mail-two-trash-folders.page
210         mail-usenet-subscriptions.page
211         mail-vertical-view.page
212         mail-word-wrap.page
213         mail-working-offline.page
214         memos-searching.page
215         memos-usage-add-memo.page
216         memos-usage-delete-memo.page
217         memos-usage-edit-memo.page
218         memos-usage.page
219         offline.page
220         organizing.page
221         problems-debug-how-to.page
222         problems-getting-help.page
223         problems-reporting-bugs.page
224         searching-items.page
225         sync-with-other-devices.page
226         tasks-caldav.page
227         tasks-display-settings.page
228         tasks-local.page
229         tasks-organizing.page
230         tasks-searching.page
231         tasks-usage-add-task.page
232         tasks-usage-delete-task.page
233         tasks-usage-edit-task.page
234         tasks-usage.page
235         tasks-using-several-tasklists.page
236         tasks-webdav.page
237         using-categories.page
238         xinclude-filter-vfolder-conditions.xml
239         xinclude-mail-account-identity.xml
240         xinclude-searching.xml
243 add_custom_target(help-files ALL)
245 macro(create_help_files_for_lang _lang _helpfilesvar)
246         set(pofile "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_lang}.po")
247         set(mofile "${CMAKE_CURRENT_BINARY_DIR}/${dir}/${_lang}.mo")
249         if(NOT EXISTS ${pofile})
250                 message(FATAL_ERROR "Passed incorrect language '${_lang}' to create_help_files_for_lang()")
251         endif(NOT EXISTS ${pofile})
253         set(installed)
254         set(deps)
255         foreach(_file ${HELP_FILES})
256                 list(APPEND installed ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/${_file})
257                 list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
258                 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
259                         list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
260                 endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
261         endforeach(_file)
262         foreach(_file ${HELP_MEDIA})
263                 list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
264                 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
265                         list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
266                 endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
267         endforeach(_file)
269         add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
270                 COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${_lang}"
271                 COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o "${mofile}" "${pofile}"
272                 COMMAND ${CMAKE_COMMAND} -E env d="${CMAKE_CURRENT_SOURCE_DIR}/C"
273                         itstool -m "${mofile}" ${${_helpfilesvar}} --output ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/
274                 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/C
275                 COMMENT "Generating '${_lang}' help files"
276         )
278         add_custom_target(${_lang}-help-files
279                 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
280                         ${pofile}
281                         ${deps}
282         )
284         add_dependencies(help-files ${_lang}-help-files)
286         install(FILES ${installed}
287                 DESTINATION ${SHARE_INSTALL_PREFIX}/help/${_lang}/${HELP_ID}/
288         )
289 endmacro(create_help_files_for_lang)
291 file(GLOB directories RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
292 foreach(dir ${directories})
293         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
294                 list(APPEND helpdeps "${CMAKE_CURRENT_BINARY_DIR}/${dir}/index.page")
295                 create_help_files_for_lang(${dir} HELP_FILES)
297                 foreach(_media ${HELP_MEDIA})
298                         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
299                                 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}
300                                         DESTINATION ${SHARE_INSTALL_PREFIX}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
301                                 )
302                         else(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
303                                 # Pity, no symlink ability here
304                                 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/C/${_media}
305                                         DESTINATION ${SHARE_INSTALL_PREFIX}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
306                                 )
307                         endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
308                 endforeach(_media)
309         endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
310 endforeach(dir)
312 set(cinstalled)
313 foreach(_file ${HELP_FILES})
314         list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
315 endforeach(_file)
317 install(FILES ${cinstalled}
318         DESTINATION ${SHARE_INSTALL_PREFIX}/help/C/${HELP_ID}/
321 set(cinstalled)
322 foreach(_file ${HELP_MEDIA})
323         list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
324 endforeach(_file)
326 install(FILES ${cinstalled}
327         DESTINATION ${SHARE_INSTALL_PREFIX}/help/C/${HELP_ID}/${HELP_FIGURES_DIR}
330 add_subdirectory(quickref)