Update Slovak translation
[evolution.git] / help / CMakeLists.txt
bloba4ca9d8c631883e119808436ac59988e931b7669
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         contacts-add-automatically.page
59         contacts-autocompletion.page
60         contacts-google.page
61         contacts-ldap.page
62         contacts-libreoffice.page
63         contacts-local.page
64         contacts-organizing.page
65         contacts-searching.page
66         contacts-usage-add-contact.page
67         contacts-usage-delete-contact.page
68         contacts-usage-edit-contact.page
69         contacts-usage.page
70         contacts-using-contact-lists.page
71         contacts-using-several-addressbooks.page
72         credits.page
73         customize-ui-items.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         exporting-data-calendar.page
80         exporting-data-contacts.page
81         exporting-data-mail.page
82         exporting-data.page
83         google-services.page
84         import-apps-mozilla.page
85         import-apps-outlook.page
86         import-data.page
87         import-single-files.page
88         import-supported-file-formats.page
89         index.page
90         intro-application.page
91         intro-first-run.page
92         intro-main-window.page
93         legal.xml
94         mail-access-gmail-imap-account.page
95         mail-access-gmail-pop-account.page
96         mail-account-manage-imap-plus.page
97         mail-account-manage-local-delivery.page
98         mail-account-manage-maildir-format-directories.page
99         mail-account-management.page
100         mail-account-manage-mh-format-directories.page
101         mail-account-manage-microsoft-exchange-evo-ews.page
102         mail-account-manage-microsoft-exchange-evo-mapi.page
103         mail-account-manage-microsoft-exchange.page
104         mail-account-manage-pop.page
105         mail-account-manage-unix-mbox-spool-directory.page
106         mail-account-manage-unix-mbox-spool-file.page
107         mail-account-manage-usenet-news.page
108         mail-attachments.page
109         mail-attachments-received.page
110         mail-attachments-sending.page
111         mail-calendar-sending-invitations.page
112         mail-cannot-see.page
113         mail-change-columns-in-message-list.page
114         mail-change-time-format.page
115         mail-composer-change-quotation-string.page
116         mail-composer-custom-header-lines.page
117         mail-composer-enable-html-format.page
118         mail-composer-external-editor.page
119         mail-composer-forward.page
120         mail-composer-forward-as-attachment.page
121         mail-composer-from-field-override.page
122         mail-composer-html-image.page
123         mail-composer-html-link.page
124         mail-composer-html.page
125         mail-composer-html-rule.page
126         mail-composer-html-table.page
127         mail-composer-html-text.page
128         mail-composer-mail-signatures-manage.page
129         mail-composer-mail-signatures.page
130         mail-composer-mail-signatures-per-account.page
131         mail-composer-message-templates.page
132         mail-composer-message-templates-reply.page
133         mail-composer-message-templates-save.page
134         mail-composer-message-templates-variables.page
135         mail-composer-plain-text.page
136         mail-composer-priority.page
137         mail-composer-reply.page
138         mail-composer-search.page
139         mail-composer-send-account-overrides.page
140         mail-composer-several-recipients.page
141         mail-composer-spellcheck.page
142         mail-composer-write-new-message.page
143         mail-default-CC-and-BCC.page
144         mail-default-folder-locations.page
145         mail-delete-and-undelete.page
146         mail-displaying-character-encodings.page
147         mail-displaying-collapsible-headers.page
148         mail-displaying-images-in-html.page
149         mail-displaying-message.page
150         mail-displaying-sender-photograph.page
151         mail-display-message-source.page
152         mail-duplicates.page
153         mail-encryption-gpg-create-key.page
154         mail-encryption-gpg-decrypting.page
155         mail-encryption-gpg-getting-keys.page
156         mail-encryption-gpg-set-up.page
157         mail-encryption-gpg-signing-encrypting.page
158         mail-encryption.page
159         mail-encryption-s-mime-manage.page
160         mail-encryption-s-mime-signing-encrypting.page
161         mail-filters-actions.page
162         mail-filters-conditions.page
163         mail-filters-not-working.page
164         mail-filters.page
165         mail-folders.page
166         mail-follow-up-flag.page
167         mail-imap-subscriptions.page
168         mail-labels.page
169         mail-layout-changing.page
170         mail-localized-re-subjects.page
171         mail-moving-emails.page
172         mail-not-sent.page
173         mail-organizing.page
174         mail-reading-keyboard-shortcuts.page
175         mail-read-receipts.page
176         mail-received-notification.page
177         mail-receiving-options-exchange-ews.page
178         mail-receiving-options-exchange-mapi.page
179         mail-receiving-options-imap-plus.page
180         mail-receiving-options-local-delivery.page
181         mail-receiving-options-maildir-format-directories.page
182         mail-receiving-options-mh-format-directories.page
183         mail-receiving-options.page
184         mail-receiving-options-pop.page
185         mail-receiving-options-unix-mbox-spool-directory.page
186         mail-receiving-options-unix-mbox-spool-file.page
187         mail-receiving-options-usenet-news.page
188         mail-recognized-thread-related-headers.page
189         mail-refresh-folders.page
190         mail-save-as-pdf.page
191         mail-search-folders-add.page
192         mail-search-folders-conditions.page
193         mail-search-folders.page
194         mail-searching-attachment-type.page
195         mail-searching.page
196         mail-send-and-receive-automatically.page
197         mail-send-and-receive-manual.page
198         mail-send-and-receive.page
199         mail-sending-options-smtp.page
200         mail-several-pop-accounts.page
201         mail-sorting-message-list.page
202         mail-spam-marking.page
203         mail-spam.page
204         mail-spam-settings.page
205         mail-two-trash-folders.page
206         mail-usenet-subscriptions.page
207         mail-vertical-view.page
208         mail-word-wrap.page
209         mail-working-offline.page
210         memos-searching.page
211         memos-usage-add-memo.page
212         memos-usage-delete-memo.page
213         memos-usage-edit-memo.page
214         memos-usage.page
215         offline.page
216         organizing.page
217         problems-debug-how-to.page
218         problems-getting-help.page
219         problems-reporting-bugs.page
220         searching-items.page
221         sync-with-other-devices.page
222         tasks-caldav.page
223         tasks-display-settings.page
224         tasks-local.page
225         tasks-organizing.page
226         tasks-searching.page
227         tasks-usage-add-task.page
228         tasks-usage-delete-task.page
229         tasks-usage-edit-task.page
230         tasks-usage.page
231         tasks-using-several-tasklists.page
232         tasks-webdav.page
233         using-categories.page
234         xinclude-filter-vfolder-conditions.xml
235         xinclude-mail-account-identity.xml
236         xinclude-searching.xml
239 add_custom_target(help-files ALL)
241 macro(create_help_files_for_lang _lang _helpfilesvar)
242         set(pofile "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_lang}.po")
243         set(mofile "${CMAKE_CURRENT_BINARY_DIR}/${dir}/${_lang}.mo")
245         if(NOT EXISTS ${pofile})
246                 message(FATAL_ERROR "Passed incorrect language '${_lang}' to create_help_files_for_lang()")
247         endif(NOT EXISTS ${pofile})
249         set(installed)
250         set(deps)
251         foreach(_file ${HELP_FILES})
252                 list(APPEND installed ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/${_file})
253                 list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
254                 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
255                         list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
256                 endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
257         endforeach(_file)
258         foreach(_file ${HELP_MEDIA})
259                 list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/C/${_file})
260                 if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
261                         list(APPEND deps ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
262                 endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${_file})
263         endforeach(_file)
265         add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
266                 COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${_lang}"
267                 COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o "${mofile}" "${pofile}"
268                 COMMAND ${CMAKE_COMMAND} -E env d="${CMAKE_CURRENT_SOURCE_DIR}/C"
269                         itstool -m "${mofile}" ${${_helpfilesvar}} --output ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/
270                 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/C
271                 COMMENT "Generating '${_lang}' help files"
272         )
274         add_custom_target(${_lang}-help-files
275                 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_lang}/index.page
276                         ${pofile}
277                         ${deps}
278         )
280         add_dependencies(help-files ${_lang}-help-files)
282         install(FILES ${installed}
283                 DESTINATION ${SHARE_INSTALL_PREFIX}/help/${_lang}/${HELP_ID}/
284         )
285 endmacro(create_help_files_for_lang)
287 file(GLOB directories RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
288 foreach(dir ${directories})
289         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
290                 list(APPEND helpdeps "${CMAKE_CURRENT_BINARY_DIR}/${dir}/index.page")
291                 create_help_files_for_lang(${dir} HELP_FILES)
293                 foreach(_media ${HELP_MEDIA})
294                         if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
295                                 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}
296                                         DESTINATION ${SHARE_INSTALL_PREFIX}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
297                                 )
298                         else(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
299                                 # Pity, no symlink ability here
300                                 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/C/${_media}
301                                         DESTINATION ${SHARE_INSTALL_PREFIX}/help/${dir}/${HELP_ID}/${HELP_FIGURES_DIR}/
302                                 )
303                         endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${_media}")
304                 endforeach(_media)
305         endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${dir}.po")
306 endforeach(dir)
308 set(cinstalled)
309 foreach(_file ${HELP_FILES})
310         list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
311 endforeach(_file)
313 install(FILES ${cinstalled}
314         DESTINATION ${SHARE_INSTALL_PREFIX}/help/C/${HELP_ID}/
317 set(cinstalled)
318 foreach(_file ${HELP_MEDIA})
319         list(APPEND cinstalled "${CMAKE_CURRENT_SOURCE_DIR}/C/${_file}")
320 endforeach(_file)
322 install(FILES ${cinstalled}
323         DESTINATION ${SHARE_INSTALL_PREFIX}/help/C/${HELP_ID}/${HELP_FIGURES_DIR}
326 add_subdirectory(quickref)