From ecb4459e31a0defec084ca0a02e0450da718afdb Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 15 Nov 2011 18:48:38 +0100 Subject: [PATCH 1/3] Strip trailing whitespace Alex --- Modules/FindGettext.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 0f11234ba..7c3a2611a 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -1,5 +1,5 @@ # - Find GNU gettext tools -# This module looks for the GNU gettext tools. This module defines the +# This module looks for the GNU gettext tools. This module defines the # following values: # GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. # GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. @@ -7,8 +7,8 @@ # # Additionally it provides the following macros: # GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) -# This will create a target "translations" which will convert the -# given input po files into the binary output mo file. If the +# This will create a target "translations" which will convert the +# 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( [ALL] [INSTALL_DESTINATION ] LANGUAGES ... ) From e48fcfffa36ca34703a4c366cb96593373234faa Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 15 Nov 2011 18:49:47 +0100 Subject: [PATCH 2/3] -make GETTEXT_PROCESS_PO_FILES() work with files with multiple dots Patch by Albert Astals Cid. E.g. plasma_package_org.kde.activityswitcher.po will now be installed correctly as plasma_package_org.kde.activityswitcher.mo, and not as plasma_package_org.mo. This is kind-of related to #12282 Alex --- Modules/FindGettext.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 7c3a2611a..ffe3f2605 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -134,7 +134,8 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang) CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES}) - GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE) + GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name}) SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo) ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} From 65dde30dddbe495877a3ecfef5a2d0015449b69c Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 16 Nov 2011 20:53:59 +0100 Subject: [PATCH 3/3] FindGettext: two more fixes for files with multiple dots Another patch by Albert Astals Cid for dealing with translation files with multiple dots. Alex --- Modules/FindGettext.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index ffe3f2605..c44adb46c 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -52,7 +52,8 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) SET(_firstPoFile "${_firstPoFileArg}") SET(_gmoFiles) - GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_potName ${_potFile} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName}) GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) SET(_addToAll) @@ -92,7 +93,8 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile) CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) - GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_potName ${_potFile} NAME) + STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName}) GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) FOREACH (_lang ${_parsedArguments_LANGUAGES})