From 5512e03562694ebfe571a3b6068a7d35d9ddfd7a Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sat, 17 Apr 2021 11:02:00 +0200 Subject: Modules docs: move rst docs into bracket comments CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG --- modules/ECMCreateQmFromPoFiles.cmake | 148 +++++++++++++++++------------------ 1 file changed, 74 insertions(+), 74 deletions(-) (limited to 'modules/ECMCreateQmFromPoFiles.cmake') diff --git a/modules/ECMCreateQmFromPoFiles.cmake b/modules/ECMCreateQmFromPoFiles.cmake index 1d9bcb2e..c02ba2c7 100644 --- a/modules/ECMCreateQmFromPoFiles.cmake +++ b/modules/ECMCreateQmFromPoFiles.cmake @@ -1,81 +1,81 @@ -#.rst: -# ECMCreateQmFromPoFiles -# ---------------------- -# -# .. warning:: This module is deprecated and will be removed by ECM 1.0. Use -# ECMPoQmTools instead. -# -# Generate QTranslator (.qm) catalogs from Gettext (.po) catalogs. -# -# :: -# -# ecm_create_qm_from_po_files(PO_FILES ... -# [CATALOG_NAME ] -# [INSTALL_DESTINATION ]) -# -# Creates the necessary rules to compile .po files into .qm files, and install -# them. -# -# The .qm files are installed in ``//LC_MESSAGES``, -# where is the INSTALL_DESTINATION argument and is -# extracted from the "Language" field inside the .po file. -# -# INSTALL_DESTINATION defaults to ``${LOCALE_INSTALL_DIR}`` if defined, -# otherwise it uses ``${CMAKE_INSTALL_LOCALEDIR}`` if that is defined, otherwise -# it uses ``share/locale``. -# -# CATALOG_NAME defines the name of the installed .qm files. If set, .qm files -# will be installed as ``.qm``. If not set .qm files will be named -# after the name of their source .po file. -# -# Setting the catalog name is useful when all .po files for a target are kept -# in a single source directory. For example, the "mylib" probject might keep all -# its translations in a "po" directory, like this:: -# -# po/ -# es.po -# fr.po -# -# Without setting CATALOG_NAME, those .po will be turned into .qm and installed -# as:: -# -# share/locale/fr/LC_MESSAGES/fr.qm -# share/locale/es/LC_MESSAGES/es.qm -# -# If CATALOG_NAME is set to "mylib", they will be installed as:: -# -# share/locale/fr/LC_MESSAGES/mylib.qm -# share/locale/es/LC_MESSAGES/mylib.qm -# -# Which is what the loader created by ecm_create_qm_loader() expects. -# -# ecm_create_qm_from_po_files() creates a "translation" target. This target -# builds all .po files into .qm files. -# -# :: -# -# ecm_create_qm_loader( ) -# -# ecm_create_qm_loader() generates a C++ file which ensures translations are -# automatically loaded at startup. The path of the .cpp file is appended to -# . Typical usage is like: -# -# .. code-block:: cmake -# -# set(mylib_SRCS foo.cpp bar.cpp) -# ecm_create_qm_loader(mylib_SRCS mylib) -# add_library(mylib ${mylib_SRCS}) -# -# This generates a C++ file which loads "mylib.qm" at startup, assuming it has -# been installed by ecm_create_qm_from_po_files(), and compiles it into ``mylib``. -# -# Since pre-1.0.0. - -#============================================================================= # SPDX-FileCopyrightText: 2014 Aurélien Gâteau # # SPDX-License-Identifier: BSD-3-Clause +#[=======================================================================[.rst: +ECMCreateQmFromPoFiles +---------------------- + +.. warning:: This module is deprecated and will be removed by ECM 1.0. Use + ECMPoQmTools instead. + +Generate QTranslator (.qm) catalogs from Gettext (.po) catalogs. + +:: + + ecm_create_qm_from_po_files(PO_FILES ... + [CATALOG_NAME ] + [INSTALL_DESTINATION ]) + +Creates the necessary rules to compile .po files into .qm files, and install +them. + +The .qm files are installed in ``//LC_MESSAGES``, +where is the INSTALL_DESTINATION argument and is +extracted from the "Language" field inside the .po file. + +INSTALL_DESTINATION defaults to ``${LOCALE_INSTALL_DIR}`` if defined, +otherwise it uses ``${CMAKE_INSTALL_LOCALEDIR}`` if that is defined, otherwise +it uses ``share/locale``. + +CATALOG_NAME defines the name of the installed .qm files. If set, .qm files +will be installed as ``.qm``. If not set .qm files will be named +after the name of their source .po file. + +Setting the catalog name is useful when all .po files for a target are kept +in a single source directory. For example, the "mylib" probject might keep all +its translations in a "po" directory, like this:: + + po/ + es.po + fr.po + +Without setting CATALOG_NAME, those .po will be turned into .qm and installed +as:: + + share/locale/fr/LC_MESSAGES/fr.qm + share/locale/es/LC_MESSAGES/es.qm + +If CATALOG_NAME is set to "mylib", they will be installed as:: + + share/locale/fr/LC_MESSAGES/mylib.qm + share/locale/es/LC_MESSAGES/mylib.qm + +Which is what the loader created by ecm_create_qm_loader() expects. + +ecm_create_qm_from_po_files() creates a "translation" target. This target +builds all .po files into .qm files. + +:: + + ecm_create_qm_loader( ) + +ecm_create_qm_loader() generates a C++ file which ensures translations are +automatically loaded at startup. The path of the .cpp file is appended to +. Typical usage is like: + +.. code-block:: cmake + + set(mylib_SRCS foo.cpp bar.cpp) + ecm_create_qm_loader(mylib_SRCS mylib) + add_library(mylib ${mylib_SRCS}) + +This generates a C++ file which loads "mylib.qm" at startup, assuming it has +been installed by ecm_create_qm_from_po_files(), and compiles it into ``mylib``. + +Since pre-1.0.0. +#]=======================================================================] + message(AUTHOR_WARNING "ECMCreateQmFromPoFiles is deprecated and will be removed before the release of Extra CMake Modules 1.0. Use ECMPoQmTools instead.") # Stolen from FindGettext.cmake -- cgit v1.2.1