[Cmake-commits] CMake branch, next, updated. v2.8.5-1496-gd07d12a

Alexander Neundorf neundorf at kde.org
Wed Aug 10 17:46:15 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  d07d12a09368730f471534dfcdc4bd519c9ea814 (commit)
       via  bebb2bcd2330ee7dd4c3f35276dcc8615b81645f (commit)
       via  431c8eb44cc148ae49e043e2cebfa143bfca0387 (commit)
      from  f40451894d190cfe2196fed4b71e9f9e74d31206 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d07d12a09368730f471534dfcdc4bd519c9ea814
commit d07d12a09368730f471534dfcdc4bd519c9ea814
Merge: f404518 bebb2bc
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Wed Aug 10 17:46:14 2011 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 10 17:46:14 2011 -0400

    Merge topic 'FindGetTextImprovements' into next
    
    bebb2bc Support REQUIRED in FindGettext.cmake (using FPHSA.cmake)
    431c8eb Add macros GETTEXT_PROCESS_POT() and GETTEXT_PROCESS_PO_FILES()


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bebb2bcd2330ee7dd4c3f35276dcc8615b81645f
commit bebb2bcd2330ee7dd4c3f35276dcc8615b81645f
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Aug 10 02:35:58 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Aug 10 02:35:58 2011 +0200

    Support REQUIRED in FindGettext.cmake (using FPHSA.cmake)
    
    Alex

diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 3ef141d..0f11234 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -42,6 +42,9 @@ FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
 
 FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
 
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext  REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE)
+
 INCLUDE(CMakeParseArguments)
 
 MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=431c8eb44cc148ae49e043e2cebfa143bfca0387
commit 431c8eb44cc148ae49e043e2cebfa143bfca0387
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Wed Aug 10 02:28:26 2011 +0200
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Wed Aug 10 02:28:26 2011 +0200

    Add macros GETTEXT_PROCESS_POT() and GETTEXT_PROCESS_PO_FILES()
    
    These macros (functions actually) can be used to process pot and
    po files. Patch prepared by Raphael Kubo da Costa.
    
    Alex

diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 9398b54..3ef141d 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -11,9 +11,22 @@
 #    given input po files into the binary output mo file. If the 
 #    ALL option is used, the translations will also be created when
 #    building the default target.
+# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... )
+#     Process the given pot file to mo files.
+#     If INSTALL_DESTINATION is given then automatically install rules will be created,
+#     the language subdirectory will be taken into account (by default use share/locale/).
+#     If ALL is specified, the pot file is processed when building the all traget.
+#     It creates a custom target "potfile".
+# GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>] PO_FILES <po1> <po2> ... )
+#     Process the given po files to mo files for the given language.
+#     If INSTALL_DESTINATION is given then automatically install rules will be created,
+#     the language subdirectory will be taken into account (by default use share/locale/).
+#     If ALL is specified, the po files are processed when building the all traget.
+#     It creates a custom target "pofiles".
 
 #=============================================================================
 # Copyright 2007-2009 Kitware, Inc.
+# Copyright 2007      Alexander Neundorf <neundorf at kde.org>
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -29,6 +42,8 @@ FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
 
 FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
 
+INCLUDE(CMakeParseArguments)
+
 MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
    # make it a real variable, so we can modify it here
    SET(_firstPoFile "${_firstPoFileArg}")
@@ -49,14 +64,14 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
       GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
       SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
 
-      ADD_CUSTOM_COMMAND( 
-         OUTPUT ${_gmoFile} 
+      ADD_CUSTOM_COMMAND(
+         OUTPUT ${_gmoFile}
          COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
          COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
-         DEPENDS ${_absPotFile} ${_absFile} 
+         DEPENDS ${_absPotFile} ${_absFile}
       )
 
-      INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) 
+      INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
       SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
 
    ENDFOREACH (_currentPoFile )
@@ -65,6 +80,78 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
 
 ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
 
+
+FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
+   SET(_gmoFiles)
+   SET(_options ALL)
+   SET(_oneValueArgs INSTALL_DESTINATION)
+   SET(_multiValueArgs LANGUAGES)
+
+   CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+
+   GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
+   GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+
+   FOREACH (_lang ${_parsedArguments_LANGUAGES})
+      SET(_poFile  "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
+      SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
+
+      ADD_CUSTOM_COMMAND(
+         OUTPUT "${_poFile}"
+         COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
+         DEPENDS ${_absPotFile}
+      )
+
+      ADD_CUSTOM_COMMAND(
+         OUTPUT "${_gmoFile}"
+         COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
+         DEPENDS ${_absPotFile} ${_poFile}
+      )
+
+      IF(_parsedArguments_INSTALL_DESTINATION)
+         INSTALL(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+      ENDIF(_parsedArguments_INSTALL_DESTINATION)
+      LIST(APPEND _gmoFiles ${_gmoFile})
+   ENDFOREACH (_lang )
+
+   IF(_parsedArguments_ALL)
+      ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles})
+   ELSE(_parsedArguments_ALL)
+      ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles})
+   ENDIF(_parsedArguments_ALL)
+ENDFUNCTION(GETTEXT_PROCESS_POT_FILE)
+
+
+FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
+   SET(_options ALL)
+   SET(_oneValueArgs INSTALL_DESTINATION)
+   SET(_multiValueArgs PO_FILES)
+   SET(_gmoFiles)
+
+   CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
+
+   FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES})
+      GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE)
+      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
+      ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile}
+            COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
+            WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+            DEPENDS ${_current_PO_FILE}
+         )
+
+      IF(_parsedArguments_INSTALL_DESTINATION)
+         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
+      ENDIF(_parsedArguments_INSTALL_DESTINATION)
+      LIST(APPEND _gmoFiles ${_gmoFile})
+   ENDFOREACH(_current_PO_FILE)
+
+   IF(_parsedArguments_ALL)
+      ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles})
+   ELSE(_parsedArguments_ALL)
+      ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles})
+   ENDIF(_parsedArguments_ALL)
+ENDFUNCTION(GETTEXT_PROCESS_PO_FILES)
+
 IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
    SET(GETTEXT_FOUND TRUE)
 ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
@@ -73,6 +160,3 @@ ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
       MESSAGE(FATAL_ERROR "GetText not found")
    ENDIF (GetText_REQUIRED)
 ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
-
-
-

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindGettext.cmake |  101 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 94 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list