Review Request 117560: ECMCreateQmFromPoFiles: adjust API to make it usable from within trunk/l10n-kf5
Alex Merry
alex.merry at kde.org
Tue Apr 15 16:17:21 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117560/#review55819
-----------------------------------------------------------
Ship it!
Just some documentation fixes, then it can go in.
modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38871>
The comment needs to be unbroken
modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38872>
Use double-backticks here instead of double-quotes
modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38873>
Double-backticks around the variable
modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38874>
double-backticks around <catalog_name>.qm
modules/ECMCreateQmFromPoFiles.cmake
<https://git.reviewboard.kde.org/r/117560/#comment38875>
double-backticks around variable
- Alex Merry
On April 15, 2014, 3:36 p.m., Aurélien Gâteau wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117560/
> -----------------------------------------------------------
>
> (Updated April 15, 2014, 3:36 p.m.)
>
>
> Review request for Build System, Extra Cmake Modules and KDE Frameworks.
>
>
> Repository: extra-cmake-modules
>
>
> Description
> -------
>
> Translators (are going to) translate KF5 in trunk/l10n-kf5 ( http://websvn.kde.org/trunk/l10n-kf5/ ). It is necessary to support their work-flow, which consists of:
> 1) build the code from git
> 2) builds and installs all translations from one language
>
> The patch makes several changes to ECMCreateQmFromPoFiles to support this work-flow:
>
> - It splits the code into two functions: one to create the .qm and install them, another to build the .qm loader. This way the loader can be generated even if no translations are available.
>
> - It changes the syntax of ecm_create_qm_from_po_files() to accept po files instead of a po directory. This is needed because within the same language directory some .po are going to be turned into .qm while others are turned into .mo.
>
> - It creates "translation-N" targets (like CMake gettext code does) to support multiple calls within one cmake project.
>
> - It installs to share/locale/<lang>/LC_MESSAGES (like gettext), because l10n-kf5 build system cannot know where the framework would decide to keep its .qm file, so it's simpler to use a standard place.
>
> This potentially breaks existing framework builds, but only for developers who created manually po/ directories in their work tree (almost nobody, I expect), so I think it can be pushed as is. I already have the code ready to fix existing frameworks.
>
> Those changes still support shipping translations within frameworks tarballs. Assuming this patch gets in, the build system of each framework is going to be patched like this:
>
> -----------------------------------------------------
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index b5e445c..c9a706c 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -16,6 +16,8 @@ include(GenerateExportHeader)
> include(ECMSetupVersion)
> include(ECMGenerateHeaders)
>
> +include(ECMCreateQmFromPoFiles)
> +
> set(KF5_VERSION "4.98.0")
>
> ecm_setup_version(${KF5_VERSION}
> @@ -37,14 +39,9 @@ if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
> find_package(KF5XmlGui ${KF5_VERSION} REQUIRED)
> endif()
>
> -if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/po)
> - include(ECMCreateQmFromPoFiles)
> - ecm_create_qm_from_po_files(
> - PO_DIR po
> - POT_NAME kbookmarks5.pot
> - DATA_INSTALL_SUB_DIR kbookmarks
> - CREATE_LOADER kbookmarks_QM_LOADER
> - )
> +file(GLOB PO_FILES "po/*.po")
> +if (PO_FILES)
> + ecm_create_qm_from_po_files(PO_FILES ${PO_FILES} CATALOG_NAME kbookmarks5)
> endif()
>
> add_subdirectory(src)
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 676b172..faa25e1 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -1,6 +1,8 @@
> # TODO
> remove_definitions(-DQT_NO_CAST_FROM_ASCII)
>
> +ecm_create_qm_loader(kbookmarks_QM_LOADER kbookmarks5)
> +
> set(kbookmarks_SRCS
> kbookmark.cpp
> kbookmarkaction.cpp
> -----------------------------------------------------
>
>
> Diffs
> -----
>
> modules/ECMCreateQmFromPoFiles.cmake 92d0d1a
> modules/ECMQmLoader.cpp.in 4fd9c11
>
> Diff: https://git.reviewboard.kde.org/r/117560/diff/
>
>
> Testing
> -------
>
> Built translations for KF5 from within frameworks source and from a patched l10n-kf5.
>
>
> Thanks,
>
> Aurélien Gâteau
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20140415/65ae72d5/attachment.html>
More information about the Kde-buildsystem
mailing list