Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK] [CMake] Improve the way that translations are built with the bu…
…ilt-in gettext support CMake

https://bugs.webkit.org/show_bug.cgi?id=126453

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the built-in CMake support for gettext to simplify the way we
build translation files and to automatically take care of installing them. Also adjust
the pot file build location to make the CMake build more similar to autotools.

Canonical link: https://commits.webkit.org/144431@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mrobinson committed Jan 6, 2014
1 parent fa9323e commit 765e45f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
32 changes: 9 additions & 23 deletions Source/WebCore/platform/gtk/po/CMakeLists.txt
@@ -1,5 +1,12 @@
include(FindGettext)

# GETTEXT_CREATE_TRANSLATIONS automatically runs msgmerge, which is something we
# didn't do in the old autotools build. This overwrites all the po files in the
# Source directory. Perhaps we want this, but for now disable it to maintain compatibility.
set(GETTEXT_MSGMERGE_EXECUTABLE :)

set(domain WebKitGTK-3.0)
set(build_directory ${CMAKE_BINARY_DIR}/po)
set(build_directory ${CMAKE_BINARY_DIR}/Source/WebCore/platform/gtk/po)
set(pot_file ${build_directory}/${domain}.pot)
set(potfiles_file ${build_directory}/POTFILES)

Expand All @@ -23,25 +30,4 @@ add_custom_command(
)

file(GLOB po_files *.po)
foreach (file ${po_files})
get_filename_component(language ${file} NAME_WE)
set(mo_file ${build_directory}/${language}.mo)
list(APPEND mo_files ${mo_file})

add_custom_command(
OUTPUT ${mo_file}
DEPENDS ${file}
DEPENDS ${pot_file}
COMMAND msgfmt -c -o ${mo_file} ${file}
)
endforeach ()

add_custom_target(update-mo-files ALL
DEPENDS ${mo_files}
)

add_custom_target(update-po ALL
DEPENDS update-mo-files
DEPENDS ${pot_file}
)

GETTEXT_CREATE_TRANSLATIONS(${pot_file} ALL ${po_files})
11 changes: 11 additions & 0 deletions Source/WebCore/platform/gtk/po/ChangeLog
@@ -1,3 +1,14 @@
2014-01-06 Martin Robinson <mrobinson@igalia.com>

[GTK] [CMake] Improve the way that translations are built with the built-in gettext support CMake
https://bugs.webkit.org/show_bug.cgi?id=126453

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the built-in CMake support for gettext to simplify the way we
build translation files and to automatically take care of installing them. Also adjust
the pot file build location to make the CMake build more similar to autotools.

2014-01-05 Reinout van Schouwen <reinouts@gnome.org>

[GTK] Updated Dutch translation
Expand Down

0 comments on commit 765e45f

Please sign in to comment.